From 084c02a1bf29abd922507bfae34c80151b6b2a2b Mon Sep 17 00:00:00 2001 From: KeyLime17 Date: Sat, 27 Jul 2024 16:12:12 -0400 Subject: [PATCH] Bug testing --- .gradle/8.2.1/checksums/checksums.lock | Bin 17 -> 17 bytes .gradle/8.2.1/fileHashes/fileHashes.lock | 2 +- .../modules/CinderLoE-Git.ideVirtualMain.iml | 2 +- .../com/zivilon/cinder_loe/CinderLoE.java | 18 +-- .../cinder_loe/blocks/CobbleBlock.java | 25 ++++ .../cinder_loe/blocks/cobbleDrystone.java | 38 ----- .../cinder_loe/blocks/mordorcobble.java | 36 ----- .../client/model/ModelBreeKettleHelmet.java | 19 ++- .../entity/npc/RedDwarfCommander.java | 5 + .../cinder_loe/mixins/MixinLOTRIntCache.java | 70 ++++----- .../overrides/MixinLOTRItemEntDraught.java | 134 ++++++++++++++++++ .../java/com/zivilon/cinder_loe/recipes.java | 7 +- ...Drystone.png => Cindercobble_drystone.png} | Bin ...rdorcobble.png => Cindercobble_mordor.png} | Bin 14 files changed, 219 insertions(+), 137 deletions(-) create mode 100644 src/main/java/com/zivilon/cinder_loe/blocks/CobbleBlock.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/blocks/cobbleDrystone.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/blocks/mordorcobble.java create mode 100644 src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRItemEntDraught.java rename src/main/resources/assets/lotr/textures/blocks/{cobbleDrystone.png => Cindercobble_drystone.png} (100%) rename src/main/resources/assets/lotr/textures/blocks/{mordorcobble.png => Cindercobble_mordor.png} (100%) diff --git a/.gradle/8.2.1/checksums/checksums.lock b/.gradle/8.2.1/checksums/checksums.lock index bd7127aa13a8f9897875d05f07c22885982d6bfc..e52f4da7480743f9f53d0e12a923d3bea366a7bd 100644 GIT binary patch literal 17 QcmZR6zke?nF+cz_08#-4ivR!s literal 17 VcmZQRdH - MIXIN MCP + MIXIN 1 diff --git a/src/main/java/com/zivilon/cinder_loe/CinderLoE.java b/src/main/java/com/zivilon/cinder_loe/CinderLoE.java index 6bd4dfe..7a7a439 100644 --- a/src/main/java/com/zivilon/cinder_loe/CinderLoE.java +++ b/src/main/java/com/zivilon/cinder_loe/CinderLoE.java @@ -17,9 +17,7 @@ import com.zivilon.cinder_loe.items.*; import com.zivilon.cinder_loe.tileentity.*; import com.zivilon.cinder_loe.util.Utilities; import com.zivilon.cindercore.CinderCore; -import lotr.common.block.LOTRBlockGate; import lotr.common.item.*; -import net.minecraft.client.settings.GameSettings; import net.minecraft.potion.Potion; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -75,7 +73,6 @@ import net.minecraftforge.event.world.WorldEvent; import static lotr.common.LOTRMod.horseArmorIron; import static lotr.common.item.LOTRMaterial.GONDOR; -import static lotr.common.item.LOTRMaterial.NEAR_HARAD; import net.minecraft.command.ICommandSender; import net.minecraft.command.CommandBase; @@ -126,7 +123,7 @@ public class CinderLoE { ///public static Block rustedsword; public static Block mistBlock; public static Block cutDrystone; - public static Block cobbleDrystone; + public static Block Cindercobble; public static Block reeflessCoral; public static Block silverChain; public static Block goldChain; @@ -134,7 +131,7 @@ public class CinderLoE { public static Block bronzeChain; public static Block plaster; public static Block voidblock; - public static Block mordorcobble; + //public static Block verticalWeaponRack; //Gates @@ -495,12 +492,12 @@ public class CinderLoE { // Building Blocks cutDrystone = (new cutDrystone()); GameRegistry.registerBlock(cutDrystone, "cutDrystone"); - cobbleDrystone = (new cobbleDrystone()); - GameRegistry.registerBlock(cobbleDrystone, "cobbleDrystone"); + + Cindercobble = new CobbleBlock().setBlockName("lotr:Cindercobble"); + GameRegistry.registerBlock(Cindercobble, LOTRItemBlockMetadata.class, "Cindercobble"); + plaster = (new plaster()); GameRegistry.registerBlock(plaster, "plaster"); - mordorcobble = (new mordorcobble()); - GameRegistry.registerBlock(mordorcobble, "mordorcobble"); // Gates //gatecharredportcullis = LOTRBlockGate.createWooden(false).setBlockName("lotr:gatecharredportcullis"); @@ -1152,11 +1149,10 @@ public class CinderLoE { CinderCore.registerItemFallback(Block.getIdFromBlock(bronzeChain), Block.getIdFromBlock(LOTRMod.orcChain), "cinder_loe", "1.2"); CinderCore.registerItemFallback(Block.getIdFromBlock(mistBlock), Block.getIdFromBlock(LOTRMod.utumnoPortal), "cinder_loe", "1.1"); CinderCore.registerItemFallback(Block.getIdFromBlock(cutDrystone), Block.getIdFromBlock(LOTRMod.cobblebrick), "cinder_loe", "1.2"); - CinderCore.registerItemFallback(Block.getIdFromBlock(cobbleDrystone), Block.getIdFromBlock(LOTRMod.cobblebrick), "cinder_loe", "1.2"); + CinderCore.registerItemFallback(Block.getIdFromBlock(Cindercobble), Block.getIdFromBlock(LOTRMod.cobblebrick), "cinder_loe", "1.2"); CinderCore.registerItemFallback(Block.getIdFromBlock(reeflessCoral), Block.getIdFromBlock(LOTRMod.coralReef), "cinder_loe", "1.2"); CinderCore.registerItemFallback(Block.getIdFromBlock(plaster), Block.getIdFromBlock(Blocks.brick_block), "cinder_loe", "1.2.1"); CinderCore.registerItemFallback(Block.getIdFromBlock(voidblock), Block.getIdFromBlock(Blocks.coal_block), "cinder_loe", "1.2.1"); - CinderCore.registerItemFallback(Block.getIdFromBlock(mordorcobble),Block.getIdFromBlock(LOTRMod.brick),"cinder_loe", "1.2.5"); // CinderCore.registerItemFallback(Block.getIdFromBlock(verticalWeaponRack), Block.getIdFromBlock(Blocks.fence), "cinder_loe", "1.2.4"); // == Gates == //CinderCore.registerItemFallback(Block.getIdFromBlock(gatecharredportcullis), Block.getIdFromBlock(LOTRMod.gateWoodenCross), "cinder_loe", "1.2.5"); diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/CobbleBlock.java b/src/main/java/com/zivilon/cinder_loe/blocks/CobbleBlock.java new file mode 100644 index 0000000..f433789 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/CobbleBlock.java @@ -0,0 +1,25 @@ +package com.zivilon.cinder_loe.blocks; + +import lotr.common.LOTRCreativeTabs; +import lotr.common.block.LOTRBlockBrick2; +import lotr.common.block.LOTRBlockBrickBase; +import net.minecraft.creativetab.CreativeTabs; + +import java.lang.reflect.Field; + +public class CobbleBlock extends LOTRBlockBrickBase { + + public CobbleBlock() { + /* + try { + Field tabField = LOTRCreativeTabs.class.getDeclaredField("tabBlock"); // Stupid workaround because ForgeGradle tries to obfuscate field LOTRCreativeTabs.tabBlock when it's not supposed to + LOTRCreativeTabs tab = (LOTRCreativeTabs)tabField.get(null); + setCreativeTab((CreativeTabs)tab); + } catch (NoSuchFieldException | IllegalAccessException e) { + e.printStackTrace(); + } + */ + + this.setBrickNames("drystone", "mordor"); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/cobbleDrystone.java b/src/main/java/com/zivilon/cinder_loe/blocks/cobbleDrystone.java deleted file mode 100644 index ea88acc..0000000 --- a/src/main/java/com/zivilon/cinder_loe/blocks/cobbleDrystone.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.zivilon.cinder_loe.blocks; - -import com.zivilon.cinder_loe.util.Utilities; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import lotr.common.LOTRCreativeTabs; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; - -import java.lang.reflect.Field; - -public class cobbleDrystone extends Block { - - public cobbleDrystone() { - super(Material.rock); // Choose the appropriate material - try { - Field tabField = LOTRCreativeTabs.class.getDeclaredField("tabBlock"); // Stupid workaround because ForgeGradle tries to obfuscate field LOTRCreativeTabs.tabBlock when it's not supposed to - LOTRCreativeTabs tab = (LOTRCreativeTabs)tabField.get(null); - setCreativeTab((CreativeTabs)tab); - } catch (NoSuchFieldException | IllegalAccessException e) { - e.printStackTrace(); - } - // Set other properties like hardness, resistance, name, etc. - setHardness(2.0F); - setResistance(5.0F); - setBlockTextureName(Utilities.toSnakeCase("lotr:cobble_drystone")); - setBlockName("lotr:cobbleDrystone"); - // setCreativeTab((CreativeTabs) LOTRCreativeTabs.tabBlock); - } - - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister iconRegister) { - this.blockIcon = iconRegister.registerIcon("lotr:cobbleDrystone"); - } - -} diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/mordorcobble.java b/src/main/java/com/zivilon/cinder_loe/blocks/mordorcobble.java deleted file mode 100644 index bd697fd..0000000 --- a/src/main/java/com/zivilon/cinder_loe/blocks/mordorcobble.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.zivilon.cinder_loe.blocks; - -import com.zivilon.cinder_loe.util.Utilities; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import lotr.common.LOTRCreativeTabs; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; - -import java.lang.reflect.Field; - -public class mordorcobble extends Block { - public mordorcobble() { - super(Material.rock); - - try { - Field tabField = LOTRCreativeTabs.class.getDeclaredField("tabBlock"); - LOTRCreativeTabs tab = (LOTRCreativeTabs)tabField.get((Object)null); - this.setCreativeTab(tab); - } catch (IllegalAccessException | NoSuchFieldException var3) { - ReflectiveOperationException e = var3; - e.printStackTrace(); - } - - this.setHardness(2.0F); - this.setResistance(5.0F); - this.setBlockTextureName(Utilities.toSnakeCase("lotr:mordorcobble")); - this.setBlockName("lotr:mordorcobble"); - } - - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister iconRegister) { - this.blockIcon = iconRegister.registerIcon("lotr:mordorcobble"); - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/client/model/ModelBreeKettleHelmet.java b/src/main/java/com/zivilon/cinder_loe/client/model/ModelBreeKettleHelmet.java index de4df39..b7835de 100644 --- a/src/main/java/com/zivilon/cinder_loe/client/model/ModelBreeKettleHelmet.java +++ b/src/main/java/com/zivilon/cinder_loe/client/model/ModelBreeKettleHelmet.java @@ -1,36 +1,41 @@ package com.zivilon.cinder_loe.client.model; import lotr.client.model.LOTRModelBiped; -import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; - public class ModelBreeKettleHelmet extends LOTRModelBiped { public ModelRenderer shape9; public ModelBreeKettleHelmet(float f) { - super (f); + super(f); // Call the parent constructor to initialize the biped parts + this.textureWidth = 64; this.textureHeight = 32; - this.shape9 = new ModelRenderer(this, -2, 16); + + // Define the shape9 part and attach it to bipedHead + this.shape9 = new ModelRenderer(this, 0, 16); this.shape9.setRotationPoint(0.0F, 0.0F, 0.0F); - this.shape9.addBox(-7.5F, -6.0F, -7.5F, 15, 0, 15, 0.0F); + //shape9.addBox(0F, -13F, -4F, 0, 4, 10); + this.shape9.addBox(-7.0F, -6.0F, -7.0F, 14, 0, 14, 0.0F); + // Clear any previously defined parts for the bipedHead this.bipedHead.cubeList.clear(); + // Define the main helmet part and attach shape9 to it this.bipedHead = new ModelRenderer(this, 0, 0); this.bipedHead.setRotationPoint(0.0F, 0.0F, 0.0F); - this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.5F); + // this.bipedHead.addBox(-4.5F, -9.0F, -4.5F, 9, 9, 9, 0.5F); // Adjusted position and scale + this.bipedHead.addBox(-4F, -8F, -4F, 8, 8, 8, f); // Adjusted position and scale (f) this.bipedHead.addChild(this.shape9); + // Clear unnecessary parts this.bipedHeadwear.cubeList.clear(); this.bipedBody.cubeList.clear(); this.bipedRightArm.cubeList.clear(); this.bipedLeftArm.cubeList.clear(); this.bipedRightLeg.cubeList.clear(); this.bipedLeftLeg.cubeList.clear(); - } @Override diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/RedDwarfCommander.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/RedDwarfCommander.java index 0888b6c..dadc92b 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/RedDwarfCommander.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/RedDwarfCommander.java @@ -1,6 +1,7 @@ package com.zivilon.cinder_loe.entity.npc; import lotr.common.LOTRMod; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IEntityLivingData; import net.minecraft.item.ItemStack; import net.minecraft.world.World; @@ -48,4 +49,8 @@ public class RedDwarfCommander extends LOTREntityDwarfCommander implements LOTRU public ItemStack getPickedResult(MovingObjectPosition target) { return new ItemStack(CinderLoE.redDwarfCommanderSpawnEgg, 1); } + + @Override + public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) { + } } diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRIntCache.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRIntCache.java index b3d5d36..bcb9aef 100644 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRIntCache.java +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRIntCache.java @@ -3,24 +3,11 @@ package com.zivilon.cinder_loe.mixins; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Shadow; - -import net.minecraft.world.gen.layer.GenLayer; -import cpw.mods.fml.common.FMLLog; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import lotr.common.LOTRDimension; -import lotr.common.world.biome.LOTRBiome; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import java.util.Random; - -import lotr.common.world.genlayer.LOTRGenLayerRemoveMapRivers; -import lotr.common.world.genlayer.LOTRGenLayer; import lotr.common.world.genlayer.LOTRIntCache; import com.zivilon.cinder_loe.util.Utilities; +import java.util.List; + @Mixin(LOTRIntCache.class) public abstract class MixinLOTRIntCache { @@ -41,32 +28,37 @@ public abstract class MixinLOTRIntCache { @Overwrite(remap = false) public int[] getIntArray(int size) { - if (size <= 256) { - if (this.freeSmallArrays.isEmpty()) { - int[] arrayOfInt1 = new int[256]; - this.inUseSmallArrays.add(arrayOfInt1); - return arrayOfInt1 == null ? Utilities.LOTRIntCache : cacheInts(arrayOfInt1); + try { + if (size <= 256) { + if (this.freeSmallArrays.isEmpty()) { + int[] arrayOfInt1 = new int[256]; + this.inUseSmallArrays.add(arrayOfInt1); + return cacheInts(arrayOfInt1); + } + int[] arrayOfInt = this.freeSmallArrays.remove(this.freeSmallArrays.size() - 1); + this.inUseSmallArrays.add(arrayOfInt); + return cacheInts(arrayOfInt); } - int[] arrayOfInt = this.freeSmallArrays.remove(this.freeSmallArrays.size() - 1); - this.inUseSmallArrays.add(arrayOfInt); - return arrayOfInt == null ? Utilities.LOTRIntCache : cacheInts(arrayOfInt); - } - if (size > this.intCacheSize) { - this.intCacheSize = size; - this.freeLargeArrays.clear(); - this.inUseLargeArrays.clear(); - int[] arrayOfInt = new int[this.intCacheSize]; - this.inUseLargeArrays.add(arrayOfInt); - return arrayOfInt == null ? Utilities.LOTRIntCache : cacheInts(arrayOfInt); - } - if (this.freeLargeArrays.isEmpty()) { - int[] arrayOfInt = new int[this.intCacheSize]; - this.inUseLargeArrays.add(arrayOfInt); - return arrayOfInt == null ? Utilities.LOTRIntCache : cacheInts(arrayOfInt); + if (size > this.intCacheSize) { + this.intCacheSize = size; + this.freeLargeArrays.clear(); + this.inUseLargeArrays.clear(); + int[] arrayOfInt = new int[this.intCacheSize]; + this.inUseLargeArrays.add(arrayOfInt); + return cacheInts(arrayOfInt); + } + if (this.freeLargeArrays.isEmpty()) { + int[] arrayOfInt = new int[this.intCacheSize]; + this.inUseLargeArrays.add(arrayOfInt); + return cacheInts(arrayOfInt); + } + int[] ints = this.freeLargeArrays.remove(this.freeLargeArrays.size() - 1); + this.inUseLargeArrays.add(ints); + return cacheInts(ints); + } catch (IndexOutOfBoundsException e) { + System.err.println("Caught IndexOutOfBoundsException in getIntArray: " + e.getMessage()); + return new int[size]; } - int[] ints = this.freeLargeArrays.remove(this.freeLargeArrays.size() - 1); - this.inUseLargeArrays.add(ints); - return ints == null ? Utilities.LOTRIntCache : cacheInts(ints); } private int[] cacheInts(int[] ints) { diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRItemEntDraught.java b/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRItemEntDraught.java new file mode 100644 index 0000000..7eac88c --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRItemEntDraught.java @@ -0,0 +1,134 @@ +package com.zivilon.cinder_loe.mixins.overrides; + +import lotr.common.LOTRAchievement; +import lotr.common.LOTRLevelData; +import lotr.common.block.LOTRBlockSaplingBase; +import lotr.common.entity.npc.LOTREntityDarkHuorn; +import lotr.common.entity.npc.LOTREntityHuorn; +import lotr.common.entity.npc.LOTREntityTree; +import lotr.common.entity.npc.LOTRHiredNPCInfo; +import lotr.common.fac.LOTRAlignmentValues; +import lotr.common.fac.LOTRFaction; +import lotr.common.item.LOTRItemEntDraught; +import lotr.common.item.LOTRItemPotion; +import lotr.common.item.LOTRPoisonedDrinks; +import net.minecraft.block.Block; +import net.minecraft.block.BlockSapling; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.init.Items; + +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.*; +import net.minecraft.world.World; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; + +import java.util.List; +import java.util.Random; + +@Mixin(LOTRItemEntDraught.class) +public abstract class MixinLOTRItemEntDraught { + + + private LOTRItemEntDraught.DraughtInfo getDraughtInfo(ItemStack itemstack) { + int i = itemstack.getItemDamage(); + if (i >= LOTRItemEntDraught.draughtTypes.length) { + i = 0; + } + return LOTRItemEntDraught.draughtTypes[i]; + } + + + /** + * @author + * @reason + */ + @Overwrite + public ItemStack onEaten(ItemStack itemstack, World world, EntityPlayer entityplayer) { + + final Random rand = new Random(); + int chance = rand.nextInt(100); + + if (chance < 20) { + if (!world.isRemote) { + entityplayer.addPotionEffect(new PotionEffect(Potion.poison.id, 400)); + ChatComponentText message = new ChatComponentText("As you drink, you taste the bitter tears of Yavanna's Shepherds..."); + ChatStyle style = new ChatStyle(); + style.setColor(EnumChatFormatting.RED); // Set color to red + message.setChatStyle(style); + entityplayer.addChatMessage(message); + } + } else { + if (entityplayer.canEat(false)) { + entityplayer.getFoodStats().addStats(this.getDraughtInfo((ItemStack)itemstack).heal, this.getDraughtInfo((ItemStack)itemstack).saturation); + } + if (!world.isRemote) { + List effects = this.getDraughtInfo((ItemStack)itemstack).effects; + for (int i = 0; i < effects.size(); ++i) { + PotionEffect effect = (PotionEffect)effects.get(i); + entityplayer.addPotionEffect(new PotionEffect(effect.getPotionID(), effect.getDuration())); + } + } + if (!world.isRemote && entityplayer.getCurrentEquippedItem() == itemstack) { + LOTRLevelData.getData(entityplayer).addAchievement(LOTRAchievement.drinkEntDraught); + } + } + return !entityplayer.capabilities.isCreativeMode ? new ItemStack(Items.bowl) : itemstack; + } + + /** + * @author + * @reason + */ + @Overwrite + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int side, float f, float f1, float f2) { + if (this.getDraughtInfo((ItemStack)itemstack).name.equals("gold")) { + if (LOTRLevelData.getData(entityplayer).getAlignment(LOTRFaction.FANGORN) < 500.0f) { + if (!world.isRemote) { + LOTRAlignmentValues.notifyAlignmentNotHighEnough(entityplayer, 500.0f, LOTRFaction.FANGORN); + } + return false; + } + Block block = world.getBlock(i, j, k); + int meta = world.getBlockMetadata(i, j, k); + if (block instanceof BlockSapling || block instanceof LOTRBlockSaplingBase) { + meta &= 7; + for (int huornType = 0; huornType < LOTREntityTree.TYPES.length; ++huornType) { + if (block != LOTREntityTree.SAPLING_BLOCKS[huornType] || meta != LOTREntityTree.SAPLING_META[huornType]) continue; + LOTREntityDarkHuorn darkhuorn = new LOTREntityDarkHuorn(world); + darkhuorn.setTreeType(huornType); + darkhuorn.isNPCPersistent = true; + darkhuorn.liftSpawnRestrictions = true; + darkhuorn.setLocationAndAngles((double)i + 0.5, j, (double)k + 0.5, 0.0f, 0.0f); + if (!darkhuorn.getCanSpawnHere()) continue; + if (!world.isRemote) { + world.spawnEntityInWorld((Entity)darkhuorn); + ChatComponentText message = new ChatComponentText("You have raised a Huorn.. However it cries for the deaths of its kin"); + ChatStyle style = new ChatStyle(); + style.setColor(EnumChatFormatting.RED); // Set color to red + message.setChatStyle(style); + entityplayer.addChatMessage(message); + LOTRLevelData.getData(entityplayer).addAchievement(LOTRAchievement.summonHuorn); + } + for (int l = 0; l < 24; ++l) { + double d = (double)i + 0.5 - world.rand.nextDouble() * 2.0 + world.rand.nextDouble() * 2.0; + double d1 = (double)j + world.rand.nextDouble() * 4.0; + double d2 = (double)k + 0.5 - world.rand.nextDouble() * 2.0 + world.rand.nextDouble() * 2.0; + world.spawnParticle("angryVillager", d, d1, d2, 0.0, 0.0, 0.0); + } + if (!entityplayer.capabilities.isCreativeMode) { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, new ItemStack(Items.bowl)); + } + return true; + } + } + } + return false; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/recipes.java b/src/main/java/com/zivilon/cinder_loe/recipes.java index f1b3f34..074af8f 100644 --- a/src/main/java/com/zivilon/cinder_loe/recipes.java +++ b/src/main/java/com/zivilon/cinder_loe/recipes.java @@ -95,7 +95,6 @@ public class recipes { GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.pelmen), Items.wheat, "meat", LOTRMod.salt)); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.mordorcobble), LOTRMod.mordorGravel, LOTRMod.rock, LOTRMod.mordorGravel, LOTRMod.rock)); GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(CinderLoE.cinderBlock), new Object[] { "XXX", "XYX", "XXX", Character.valueOf('X'), Blocks.stone, Character.valueOf('Y'), LOTRMod.balrogFire })); GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(CinderLoE.reedBale), new Object[] { "XXX", "XXX", "XXX", @@ -118,11 +117,11 @@ public class recipes { Character.valueOf('X'), Items.iron_ingot})); GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(CinderLoE.bronzeChain, 8), new Object[] { "X", "X", "X", Character.valueOf('X'), LOTRMod.bronze})); - GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(CinderLoE.cobbleDrystone, 4), new Object[] { "XX", "XX", + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(CinderLoE.Cindercobble, 4, 0), new Object[] { "XX", "XX", Character.valueOf('X'), LOTRMod.cobblebrick})); GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(CinderLoE.cutDrystone, 4), new Object[] { "XX", "XX", - Character.valueOf('X'), CinderLoE.cobbleDrystone})); - GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(LOTRMod.cobblebrick, 4), new Object[] { "XX", "XX", + Character.valueOf('X'), new ItemStack(CinderLoE.Cindercobble, 1, 0)})); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(LOTRMod.cobblebrick, 4, 0), new Object[] { "XX", "XX", Character.valueOf('X'), CinderLoE.cutDrystone})); GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(CinderLoE.reeflessCoral, 1), new Object[] { "X", Character.valueOf('X'), LOTRMod.coralReef})); diff --git a/src/main/resources/assets/lotr/textures/blocks/cobbleDrystone.png b/src/main/resources/assets/lotr/textures/blocks/Cindercobble_drystone.png similarity index 100% rename from src/main/resources/assets/lotr/textures/blocks/cobbleDrystone.png rename to src/main/resources/assets/lotr/textures/blocks/Cindercobble_drystone.png diff --git a/src/main/resources/assets/lotr/textures/blocks/mordorcobble.png b/src/main/resources/assets/lotr/textures/blocks/Cindercobble_mordor.png similarity index 100% rename from src/main/resources/assets/lotr/textures/blocks/mordorcobble.png rename to src/main/resources/assets/lotr/textures/blocks/Cindercobble_mordor.png