Watcher Eyes. needs textures. Half of Watcher Eyes drops from Watchers with a 25 or 10 percent chance i cant remember. Combine 2 in a crafting table to make Watcher Eyes which are just Ender Eyes. we *could* use it to locate the new biome which i still havent found 😭

This commit is contained in:
Cirsius 2025-02-18 22:45:10 -06:00
parent 1f84bf013b
commit 90853d1099
13 changed files with 482 additions and 69 deletions

View File

@ -103,6 +103,9 @@ item.ender_backpack.name=Ender Backpack
container.fabricator=Fabricator
tile.fabricator.name=Fabricator
item.watcheyehalf.name=Half of Watcher Eye
item.watcheye.name=Watcher Eye
item.amber.name=Amber
item.ambered_bow.name=Ambered Bow

View File

@ -0,0 +1,18 @@
{
"parent": "builtin/generated",
"textures": {
"layer0": "items/watcheye"
},
"display": {
"thirdperson": {
"rotation": [-90, 0, 0],
"translation": [0, 1, -3],
"scale": [0.55, 0.55, 0.55]
},
"firstperson": {
"rotation": [0, -135, 25],
"translation": [0, 4, 2],
"scale": [1.7, 1.7, 1.7]
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

View File

@ -46,59 +46,10 @@ import net.minecraft.entity.ai.EntityMinecartMobSpawner;
import net.minecraft.entity.boss.EntityDragon;
import net.minecraft.entity.boss.EntityWither;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.item.EntityArmorStand;
import net.minecraft.entity.item.EntityBoat;
import net.minecraft.entity.item.EntityEnderCrystal;
import net.minecraft.entity.item.EntityEnderEye;
import net.minecraft.entity.item.EntityEnderPearl;
import net.minecraft.entity.item.EntityExpBottle;
import net.minecraft.entity.item.EntityFallingBlock;
import net.minecraft.entity.item.EntityFireworkRocket;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.item.EntityItemFrame;
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.entity.item.EntityMinecartTNT;
import net.minecraft.entity.item.EntityPainting;
import net.minecraft.entity.item.EntityTNTPrimed;
import net.minecraft.entity.item.EntityXPOrb;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.monster.EntityCaveSpider;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.monster.EntityEndermite;
import net.minecraft.entity.monster.EntityGhast;
import net.minecraft.entity.monster.EntityGiantZombie;
import net.minecraft.entity.monster.EntityGuardian;
import net.minecraft.entity.monster.EntityIronGolem;
import net.minecraft.entity.monster.EntityMagmaCube;
import net.minecraft.entity.monster.EntityPigZombie;
import net.minecraft.entity.monster.EntitySilverfish;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.entity.monster.EntitySnowman;
import net.minecraft.entity.monster.EntitySpider;
import net.minecraft.entity.monster.EntityWitch;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.passive.EntityBat;
import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.entity.passive.EntityMooshroom;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.entity.passive.EntityPig;
import net.minecraft.entity.passive.EntityRabbit;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.passive.EntitySquid;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.passive.EntityWolf;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.entity.projectile.EntityEgg;
import net.minecraft.entity.projectile.EntityFishHook;
import net.minecraft.entity.projectile.EntityLargeFireball;
import net.minecraft.entity.projectile.EntityPotion;
import net.minecraft.entity.projectile.EntitySmallFireball;
import net.minecraft.entity.projectile.EntitySnowball;
import net.minecraft.entity.projectile.EntityWitherSkull;
import net.minecraft.entity.item.*;
import net.minecraft.entity.monster.*;
import net.minecraft.entity.passive.*;
import net.minecraft.entity.projectile.*;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.util.AxisAlignedBB;

View File

@ -42,6 +42,7 @@ import net.minecraft.network.Packet;
import net.minecraft.util.ReportedException;
import net.minecraft.world.WorldServer;
import net.minecraft.world.chunk.Chunk;
import net.starlikeclient.minecraft.entities.entity.EntityWatcherEye;
/**
* + This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source
@ -199,6 +200,8 @@ public class EntityTracker {
this.addEntityToTracker(parEntity, 64, 10, true);
} else if (parEntity instanceof EntityEnderEye) {
this.addEntityToTracker(parEntity, 64, 4, true);
} else if (parEntity instanceof EntityWatcherEye) {
this.addEntityToTracker(parEntity, 64, 4, true);
} else if (parEntity instanceof EntityEgg) {
this.addEntityToTracker(parEntity, 64, 10, true);
} else if (parEntity instanceof EntityPotion) {

View File

@ -61,6 +61,7 @@ import net.minecraft.potion.PotionEffect;
import net.minecraft.util.BlockPos;
import net.minecraft.util.MathHelper;
import net.minecraft.world.storage.MapData;
import net.starlikeclient.minecraft.entities.entity.EntityWatcherEye;
/**
* + This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source
@ -174,6 +175,8 @@ public class EntityTrackerEntry {
return new S0EPacketSpawnObject(this.trackedEntity, 65);
} else if (this.trackedEntity instanceof EntityEnderEye) {
return new S0EPacketSpawnObject(this.trackedEntity, 72);
} else if (this.trackedEntity instanceof EntityWatcherEye) {
return new S0EPacketSpawnObject(this.trackedEntity, 77);
} else if (this.trackedEntity instanceof EntityFireworkRocket) {
return new S0EPacketSpawnObject(this.trackedEntity, 76);
} else if (this.trackedEntity instanceof EntityFireball) {

View File

@ -11,11 +11,7 @@ import net.minecraft.item.ItemMap;
import net.minecraft.item.ItemPotion;
import net.minecraft.item.ItemShears;
import net.minecraft.util.ResourceLocation;
import net.starlikeclient.minecraft.items.ItemBackpack;
import net.starlikeclient.minecraft.items.ItemChisel;
import net.starlikeclient.minecraft.items.ItemEnderBackpack;
import net.starlikeclient.minecraft.items.ItemRevolver;
import net.starlikeclient.minecraft.items.*;
/**
* + This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source
* code.
@ -267,6 +263,8 @@ public class Items {
public static Item bullet;
public static Item revolver_handle;
public static Item revolver_barrel;
public static Item watcheyehalf;
public static ItemWatcherEye watcheye;
static void doBootstrap() {
if (!Bootstrap.isRegistered()) {
@ -500,6 +498,8 @@ public class Items {
bullet = getRegisteredItem("starlike:bullet");
revolver_barrel = getRegisteredItem("starlike:revolver_barrel");
revolver_handle = getRegisteredItem("starlike:revolver_handle");
watcheyehalf = getRegisteredItem("starlike:watcheyehalf");
watcheye = (ItemWatcherEye) getRegisteredItem("starlike:watcheye");
}
}

View File

@ -86,19 +86,18 @@ public class EntityWatcher extends EntityMob {
@Override
protected void dropFewItems(boolean var1, int i) {
int j = this.rand.nextInt(3) + this.rand.nextInt(1 + i);
for (int k = 0; k < j; ++k) {
this.dropItem(Items.gold_nugget, 1);
}
j = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + i);
for (int l = 0; l < j; ++l) {
this.dropItem(Items.emerald, 1);
}
if (this.rand.nextFloat() < 0.1f) {
this.dropItem(Items.watcheyehalf, 1);
}
}
/**
@ -112,7 +111,7 @@ public class EntityWatcher extends EntityMob {
@Override
protected Item getDropItem() {
return Items.emerald;
}
}
@Override
public float getEyeHeight() {

View File

@ -0,0 +1,253 @@
package net.starlikeclient.minecraft.entities.entity;
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DynamicLightManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
/**
* + This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source
* code.
*
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" Mod
* Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team
*
* EaglercraftX 1.8 patch files (c) 2022-2025 lax1dude, ayunami2000. All Rights
* Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class EntityWatcherEye extends Entity {
private double targetX;
private double targetY;
private double targetZ;
private int despawnTimer;
private boolean shatterOrDrop;
public EntityWatcherEye(World worldIn) {
super(worldIn);
this.setSize(0.25F, 0.25F);
}
public EntityWatcherEye(World worldIn, double x, double y, double z) {
super(worldIn);
this.despawnTimer = 0;
this.setSize(0.25F, 0.25F);
this.setPosition(x, y, z);
}
/**
* + If returns false, the item will not inflict any damage against entities.
*/
@Override
public boolean canAttackWithItem() {
return false;
}
@Override
protected void entityInit() {
}
/**
* + Gets how bright this entity is.
*/
@Override
public float getBrightness(float var1) {
return 1.0F;
}
@Override
public int getBrightnessForRender(float var1) {
return 15728880;
}
@Override
protected float getEaglerDynamicLightsValueSimple(float partialTicks) {
return 0.5f;
}
/**
* + Checks if the entity is in range to render by using the past in distance
* and comparing it to its average edge length * 64 * renderDistanceWeight Args:
* distance
*/
@Override
public boolean isInRangeToRenderDist(double d0) {
double d1 = this.getEntityBoundingBox().getAverageEdgeLength() * 4.0D;
if (Double.isNaN(d1)) {
d1 = 4.0D;
}
d1 = d1 * 64.0D;
return d0 < d1 * d1;
}
public void moveTowards(BlockPos parBlockPos) {
double d0 = (double) parBlockPos.getX();
int i = parBlockPos.getY();
double d1 = (double) parBlockPos.getZ();
double d2 = d0 - this.posX;
double d3 = d1 - this.posZ;
float f = MathHelper.sqrt_double(d2 * d2 + d3 * d3);
if (f > 12.0F) {
this.targetX = this.posX + d2 / (double) f * 12.0D;
this.targetZ = this.posZ + d3 / (double) f * 12.0D;
this.targetY = this.posY + 8.0D;
} else {
this.targetX = d0;
this.targetY = (double) i;
this.targetZ = d1;
}
this.despawnTimer = 0;
this.shatterOrDrop = this.rand.nextInt(5) > 0;
}
/**
* + Called to update the entity's position/logic.
*/
@Override
public void onUpdate() {
this.lastTickPosX = this.posX;
this.lastTickPosY = this.posY;
this.lastTickPosZ = this.posZ;
super.onUpdate();
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float) (MathHelper.func_181159_b(this.motionX, this.motionZ) * 180.0D
/ 3.1415927410125732D);
for (this.rotationPitch = (float) (MathHelper.func_181159_b(this.motionY, (double) f) * 180.0D
/ 3.1415927410125732D); this.rotationPitch
- this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
;
}
while (this.rotationPitch - this.prevRotationPitch >= 180.0F) {
this.prevRotationPitch += 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw < -180.0F) {
this.prevRotationYaw -= 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw >= 180.0F) {
this.prevRotationYaw += 360.0F;
}
this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
if (!this.worldObj.isRemote) {
double d0 = this.targetX - this.posX;
double d1 = this.targetZ - this.posZ;
float f1 = (float) Math.sqrt(d0 * d0 + d1 * d1);
float f2 = (float) MathHelper.func_181159_b(d1, d0);
double d2 = (double) f + (double) (f1 - f) * 0.0025D;
if (f1 < 1.0F) {
d2 *= 0.8D;
this.motionY *= 0.8D;
}
this.motionX = Math.cos((double) f2) * d2;
this.motionZ = Math.sin((double) f2) * d2;
if (this.posY < this.targetY) {
this.motionY += (1.0D - this.motionY) * 0.014999999664723873D;
} else {
this.motionY += (-1.0D - this.motionY) * 0.014999999664723873D;
}
}
float f3 = 0.25F;
if (this.isInWater()) {
for (int i = 0; i < 4; ++i) {
this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX - this.motionX * (double) f3,
this.posY - this.motionY * (double) f3, this.posZ - this.motionZ * (double) f3, this.motionX,
this.motionY, this.motionZ, new int[0]);
}
} else {
this.worldObj.spawnParticle(EnumParticleTypes.PORTAL,
this.posX - this.motionX * (double) f3 + this.rand.nextDouble() * 0.6D - 0.3D,
this.posY - this.motionY * (double) f3 - 0.5D,
this.posZ - this.motionZ * (double) f3 + this.rand.nextDouble() * 0.6D - 0.3D, this.motionX,
this.motionY, this.motionZ, new int[0]);
}
if (!this.worldObj.isRemote) {
this.setPosition(this.posX, this.posY, this.posZ);
++this.despawnTimer;
if (this.despawnTimer > 80 && !this.worldObj.isRemote) {
this.setDead();
if (this.shatterOrDrop) {
this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY, this.posZ,
new ItemStack(Items.watcheye)));
} else {
this.worldObj.playAuxSFX(2003, new BlockPos(this), 0);
}
}
}
}
/**
* + (abstract) Protected helper method to read subclass entity data from NBT.
*/
@Override
public void readEntityFromNBT(NBTTagCompound var1) {
}
@Override
protected void renderDynamicLightsEaglerAt(double entityX, double entityY, double entityZ, double renderX,
double renderY, double renderZ, float partialTicks, boolean isInFrustum) {
super.renderDynamicLightsEaglerAt(entityX, entityY, entityZ, renderX, renderY, renderZ, partialTicks,
isInFrustum);
if (isInFrustum && renderX * renderX + renderY * renderY + renderZ * renderZ < 150.0) {
float mag = 0.5f;
DynamicLightManager.renderDynamicLight("entity_" + getEntityId() + "_endereye", entityX, entityY + 0.2,
entityZ, mag * 0.1990f, mag * 0.7750f, mag * 0.4130f, false);
}
}
/**
* + Sets the velocity to the args. Args: x, y, z
*/
@Override
public void setVelocity(double d0, double d1, double d2) {
this.motionX = d0;
this.motionY = d1;
this.motionZ = d2;
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) {
float f = MathHelper.sqrt_double(d0 * d0 + d2 * d2);
this.prevRotationYaw = this.rotationYaw = (float) (MathHelper.func_181159_b(d0, d2) * 180.0D
/ 3.1415927410125732D);
this.prevRotationPitch = this.rotationPitch = (float) (MathHelper.func_181159_b(d1, (double) f) * 180.0D
/ 3.1415927410125732D);
}
}
/**
* + (abstract) Protected helper method to write subclass entity data to NBT.
*/
@Override
public void writeEntityToNBT(NBTTagCompound var1) {
}
}

View File

@ -1,8 +1,12 @@
package net.starlikeclient.minecraft.init;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.item.EntityEnderEye;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.init.Items;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.BiomeGenEnd;
import net.minecraft.world.biome.BiomeGenHell;
@ -10,12 +14,15 @@ import net.minecraft.world.biome.BiomeGenSwamp;
import net.starlikeclient.minecraft.entities.entity.EntityEndCreeper;
import net.starlikeclient.minecraft.entities.entity.EntityNetherCreeper;
import net.starlikeclient.minecraft.entities.entity.EntityWatcher;
import net.starlikeclient.minecraft.entities.entity.EntityWatcherEye;
import net.starlikeclient.minecraft.entities.render.RenderEndCreeper;
import net.starlikeclient.minecraft.entities.render.RenderNetherCreeper;
import net.starlikeclient.minecraft.entities.render.RenderWatcher;
import net.starlikeclient.minecraft.world.biome.BiomeGenEnderForest;
public class EntitiesStarlike {
private static RenderItem itemRendererIn;
public static void configEntities(BiomeGenBase e) {
if (e instanceof BiomeGenHell) {
e.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityNetherCreeper.class, 100, 4, 1));
@ -35,11 +42,14 @@ public class EntitiesStarlike {
0xFFFFA500);
EntityList.addMapping(EntityEndCreeper.class, EntityEndCreeper::new, "EndCreeper", 202, 0xFF6A0DAD, 0xFF000000);
EntityList.addMapping(EntityWatcher.class, EntityWatcher::new, "Watcher", 203, 0xFFFFFFFF, 0xFFFF0000);
EntityList.addMapping(EntityWatcherEye.class, EntityWatcherEye::new, "EyeOfWatcherSignal", 204);
}
public static void renderEntities(RenderManager e) {
e.entityRenderMap.put(EntityNetherCreeper.class, new RenderNetherCreeper(e));
e.entityRenderMap.put(EntityEndCreeper.class, new RenderEndCreeper(e));
e.entityRenderMap.put(EntityWatcher.class, new RenderWatcher(e));
e.entityRenderMap.put(EntityWatcherEye.class, new RenderSnowball(e, Items.watcheye, itemRendererIn));
}
}

View File

@ -23,10 +23,7 @@ import net.starlikeclient.minecraft.blocks.BlockDeepslate;
import net.starlikeclient.minecraft.blocks.BlockMosaic;
import net.starlikeclient.minecraft.blocks.BlockSmithing;
import net.starlikeclient.minecraft.blocks.BlockSteelGrate;
import net.starlikeclient.minecraft.items.ItemBackpack;
import net.starlikeclient.minecraft.items.ItemChisel;
import net.starlikeclient.minecraft.items.ItemEnderBackpack;
import net.starlikeclient.minecraft.items.ItemRevolver;
import net.starlikeclient.minecraft.items.*;
public class ItemsStarlike {
private static void blockBootstrapStates() {
@ -849,7 +846,10 @@ public class ItemsStarlike {
(new Item()).setUnlocalizedName("revolverHandle").setCreativeTab(CreativeTabs.tabStarlike));
Item.registerItem(1073, "starlike:revolver_barrel",
(new Item()).setUnlocalizedName("revolverBarrel").setCreativeTab(CreativeTabs.tabStarlike));
Item.registerItem(1074, "starlike:watcheyehalf",
(new Item()).setUnlocalizedName("watcheyehalf").setCreativeTab(CreativeTabs.tabStarlike));
Item.registerItem(1075, "starlike:watcheye",
(new ItemWatcherEye()).setUnlocalizedName("watcheye").setCreativeTab(CreativeTabs.tabStarlike));
//autogenerateregisterblock
Item.registerItemBlock(Blocks.stripped_spruce_log);
Item.registerItemBlock(Blocks.stripped_oak_log);
@ -1082,6 +1082,9 @@ public class ItemsStarlike {
e.registerItem(Items.bullet, "starlike:bullet");
e.registerItem(Items.revolver_barrel, "starlike:revolver_barrel");
e.registerItem(Items.revolver_handle, "starlike:revolver_handle");
e.registerItem(Items.watcheye, "starlike:watcheye");
e.registerItem(Items.watcheyehalf, "starlike:watcheyehalf");
//autogeneraterenderitem
e.registerBlock(Blocks.stripped_spruce_log, "starlike:stripped_spruce_log");

View File

@ -100,7 +100,15 @@ public class RecipesStarlike {
Character.valueOf('E'), Blocks.exposed_copper_grate, Character.valueOf('#'), Items.water_bucket });
e.addRecipe(new ItemStack(Blocks.oxidized_copper_grate, 8), new Object[] { "###", "#W#", "###",
Character.valueOf('W'), Blocks.weathered_copper_grate, Character.valueOf('#'), Items.water_bucket });
e.addShapelessRecipe(new ItemStack(Items.revolver, 1),
new Object[] { new ItemStack(Items.revolver_barrel, 1), new ItemStack(Items.revolver_handle, 1) });
e.addShapelessRecipe(new ItemStack(Items.bullet, 12), new Object[] { new ItemStack(Items.steel, 1) });
e.addShapelessRecipe(new ItemStack(Items.watcheye, 1),
new Object[] {
new ItemStack(Items.watcheyehalf, 1),
new ItemStack(Items.watcheyehalf, 1)
}
);
// Terracotta
e.addRecipe(new ItemStack(Blocks.packed_terracotta, 1),
new Object[] { "##", "##", Character.valueOf('#'), Blocks.hardened_clay });

View File

@ -0,0 +1,162 @@
package net.starlikeclient.minecraft.items;
import net.minecraft.block.BlockEndPortalFrame;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.StatList;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.starlikeclient.minecraft.entities.entity.EntityWatcherEye;
/**
* + This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source
* code.
*
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" Mod
* Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team
*
* EaglercraftX 1.8 patch files (c) 2022-2025 lax1dude, ayunami2000. All Rights
* Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class ItemWatcherEye extends Item {
public ItemWatcherEye() {
}
/**
* + Called whenever this item is equipped and the right mouse button is
* pressed. Args: itemStack, world, entityPlayer
*/
@Override
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) {
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityplayer, false);
if (movingobjectposition != null
&& movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK
&& world.getBlockState(movingobjectposition.getBlockPos()).getBlock() == Blocks.end_portal_frame) {
return itemstack;
} else {
if (!world.isRemote) {
BlockPos blockpos = world.getStrongholdPos("Stronghold", new BlockPos(entityplayer));
if (blockpos != null) {
EntityWatcherEye entitywatchereye = new EntityWatcherEye(world, entityplayer.posX, entityplayer.posY,
entityplayer.posZ);
entitywatchereye.moveTowards(blockpos);
world.spawnEntityInWorld(entitywatchereye);
world.playSoundAtEntity(entityplayer, "random.bow", 0.5F,
0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
world.playAuxSFXAtEntity((EntityPlayer) null, 1002, new BlockPos(entityplayer), 0);
if (!entityplayer.capabilities.isCreativeMode) {
--itemstack.stackSize;
}
entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]);
}
}
return itemstack;
}
}
/**
* + Called when a Block is right-clicked with this Item
*/
@Override
public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos,
EnumFacing enumfacing, float var6, float var7, float var8) {
IBlockState iblockstate = world.getBlockState(blockpos);
if (entityplayer.canPlayerEdit(blockpos.offset(enumfacing), enumfacing, itemstack)
&& iblockstate.getBlock() == Blocks.end_portal_frame
&& !((Boolean) iblockstate.getValue(BlockEndPortalFrame.EYE)).booleanValue()) {
if (world.isRemote) {
return true;
} else {
world.setBlockState(blockpos, iblockstate.withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(true)),
2);
world.updateComparatorOutputLevel(blockpos, Blocks.end_portal_frame);
--itemstack.stackSize;
for (int i = 0; i < 16; ++i) {
double d0 = (double) ((float) blockpos.getX() + (5.0F + itemRand.nextFloat() * 6.0F) / 16.0F);
double d1 = (double) ((float) blockpos.getY() + 0.8125F);
double d2 = (double) ((float) blockpos.getZ() + (5.0F + itemRand.nextFloat() * 6.0F) / 16.0F);
double d3 = 0.0D;
double d4 = 0.0D;
double d5 = 0.0D;
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, d3, d4, d5, new int[0]);
}
EnumFacing enumfacing1 = (EnumFacing) iblockstate.getValue(BlockEndPortalFrame.FACING);
int l = 0;
int j = 0;
boolean flag1 = false;
boolean flag = true;
EnumFacing enumfacing2 = enumfacing1.rotateY();
for (int k = -2; k <= 2; ++k) {
BlockPos blockpos2 = blockpos.offset(enumfacing2, k);
IBlockState iblockstate1 = world.getBlockState(blockpos2);
if (iblockstate1.getBlock() == Blocks.end_portal_frame) {
if (!((Boolean) iblockstate1.getValue(BlockEndPortalFrame.EYE)).booleanValue()) {
flag = false;
break;
}
j = k;
if (!flag1) {
l = k;
flag1 = true;
}
}
}
if (flag && j == l + 2) {
BlockPos blockpos1 = blockpos.offset(enumfacing1, 4);
for (int i1 = l; i1 <= j; ++i1) {
BlockPos blockpos3 = blockpos1.offset(enumfacing2, i1);
IBlockState iblockstate3 = world.getBlockState(blockpos3);
if (iblockstate3.getBlock() != Blocks.end_portal_frame
|| !((Boolean) iblockstate3.getValue(BlockEndPortalFrame.EYE)).booleanValue()) {
flag = false;
break;
}
}
for (int j1 = l - 1; j1 <= j + 1; j1 += 4) {
blockpos1 = blockpos.offset(enumfacing2, j1);
for (int l1 = 1; l1 <= 3; ++l1) {
BlockPos blockpos4 = blockpos1.offset(enumfacing1, l1);
IBlockState iblockstate2 = world.getBlockState(blockpos4);
if (iblockstate2.getBlock() != Blocks.end_portal_frame
|| !((Boolean) iblockstate2.getValue(BlockEndPortalFrame.EYE)).booleanValue()) {
flag = false;
break;
}
}
}
if (flag) {
for (int k1 = l; k1 <= j; ++k1) {
blockpos1 = blockpos.offset(enumfacing2, k1);
for (int i2 = 1; i2 <= 3; ++i2) {
BlockPos blockpos5 = blockpos1.offset(enumfacing1, i2);
world.setBlockState(blockpos5, Blocks.end_portal.getDefaultState(), 2);
}
}
}
}
return true;
}
} else {
return false;
}
}
@Override
public boolean shouldUseOnTouchEagler(ItemStack itemStack) {
return true;
}
}