
GTRxConfusion
Members-
Posts
20 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
I am new!
GTRxConfusion's Achievements

Tree Puncher (2/8)
0
Reputation
-
[1.7.10]Custom techne model wont render
GTRxConfusion replied to GTRxConfusion's topic in Modder Support
It was registered, im confident, but it wasnt rendering or even rendering tileEntityAt. But it doesent matter now, ive deleted that code and started over -
[1.7.10]Crash when crafting custom item
GTRxConfusion replied to GTRxConfusion's topic in Modder Support
Registered the rod and im still crashing. any help? -
Im trying to craft a custom item (I have the recipe added) but the game crashes whenever i try to craft it. it doesent do this for my other recipes? heres my recipe class package com.gtr.progressionplus.common; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import cpw.mods.fml.common.registry.GameRegistry; public class ModRecipes { public static void Add() { // recipes GameRegistry.addRecipe(new ItemStack(ModBlocks.compressed_obsidian), new Object[] { "xxx", "xxx", "xxx", 'x', Blocks.obsidian }); GameRegistry.addRecipe(new ItemStack(ModItems.diamond_rod), new Object[] { "#", "#", '#', Items.diamond }); ModItems.obsidianTools.AddRecipes(ModItems.obsidian_ingot, ModItems.diamond_rod); ModItems.rubyTools.AddRecipes(ModItems.ruby); ModItems.nadiumTools.AddRecipes(ModItems.nadium_ingot); // shapeless // add smelting GameRegistry.addSmelting(ModBlocks.compressed_obsidian, new ItemStack(ModItems.obsidian_ingot), 0.1f); GameRegistry.addSmelting(ModBlocks.nadium_ore, new ItemStack(ModItems.nadium_ingot), 0.1f); } } crash log ---- Minecraft Crash Report ---- // Hey, that tickles! Hehehe! Time: 7/24/14 4:56 PM Description: Updating screen events java.lang.ArrayIndexOutOfBoundsException: -1 at net.minecraft.item.ItemStack.onCrafting(ItemStack.java:483) at net.minecraft.inventory.SlotCrafting.onCrafting(SlotCrafting.java:72) at net.minecraft.inventory.SlotCrafting.onPickupFromSlot(SlotCrafting.java:129) at net.minecraft.inventory.Container.slotClick(Container.java:349) at net.minecraft.client.multiplayer.PlayerControllerMP.windowClick(PlayerControllerMP.java:482) at net.minecraft.client.gui.inventory.GuiContainer.handleMouseClick(GuiContainer.java:678) at net.minecraft.client.gui.inventory.GuiContainer.mouseClicked(GuiContainer.java:420) at net.minecraft.client.gui.GuiScreen.handleMouseInput(GuiScreen.java:346) at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:315) at net.minecraft.client.Minecraft.runTick(Minecraft.java:1730) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1038) at net.minecraft.client.Minecraft.run(Minecraft.java:961) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at GradleStart.bounce(GradleStart.java:108) at GradleStart.startClient(GradleStart.java:101) at GradleStart.main(GradleStart.java:56) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at net.minecraft.item.ItemStack.onCrafting(ItemStack.java:483) at net.minecraft.inventory.SlotCrafting.onCrafting(SlotCrafting.java:72) at net.minecraft.inventory.SlotCrafting.onPickupFromSlot(SlotCrafting.java:129) at net.minecraft.inventory.Container.slotClick(Container.java:349) at net.minecraft.client.multiplayer.PlayerControllerMP.windowClick(PlayerControllerMP.java:482) at net.minecraft.client.gui.inventory.GuiContainer.handleMouseClick(GuiContainer.java:678) at net.minecraft.client.gui.inventory.GuiContainer.mouseClicked(GuiContainer.java:420) at net.minecraft.client.gui.GuiScreen.handleMouseInput(GuiScreen.java:346) at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:315) -- Affected screen -- Details: Screen name: net.minecraft.client.gui.inventory.GuiCrafting -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityClientPlayerMP['ForgeDevName'/397, l='MpServer', x=185.90, y=65.62, z=245.27]] Chunk stats: MultiplayerChunkCache: 574, 574 Level seed: 0 Level generator: ID 00 - default, ver 1. Features enabled: false Level generator options: Level spawn location: World: (188,64,256), Chunk: (at 12,4,0 in 11,16; contains blocks 176,0,256 to 191,255,271), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Level time: 6871 game time, 6871 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false Forced entities: 94 total; [EntityPig['Pig'/275, l='MpServer', x=244.50, y=76.00, z=274.69], EntityBat['Bat'/137, l='MpServer', x=127.44, y=26.27, z=238.07], EntityPig['Pig'/274, l='MpServer', x=247.38, y=72.00, z=272.88], EntitySkeleton['Skeleton'/136, l='MpServer', x=119.53, y=22.00, z=224.94], EntityCow['Cow'/139, l='MpServer', x=127.31, y=72.00, z=233.72], EntityPig['Pig'/273, l='MpServer', x=246.81, y=71.00, z=246.44], EntityCow['Cow'/138, l='MpServer', x=121.94, y=71.00, z=228.16], EntityPig['Pig'/272, l='MpServer', x=254.13, y=75.00, z=244.25], EntityCreeper['Creeper'/141, l='MpServer', x=125.47, y=20.00, z=281.97], EntityPig['Pig'/279, l='MpServer', x=236.53, y=75.00, z=293.25], EntityBat['Bat'/140, l='MpServer', x=121.09, y=37.40, z=261.79], EntityPig['Pig'/278, l='MpServer', x=241.97, y=74.00, z=297.34], EntityPig['Pig'/277, l='MpServer', x=250.19, y=73.00, z=273.44], EntitySheep['Sheep'/143, l='MpServer', x=121.50, y=67.00, z=276.50], EntityCreeper['Creeper'/142, l='MpServer', x=126.53, y=20.00, z=280.00], EntityPig['Pig'/276, l='MpServer', x=248.53, y=72.00, z=270.25], EntityBat['Bat'/282, l='MpServer', x=206.08, y=57.00, z=313.46], EntityEnderman['Enderman'/281, l='MpServer', x=245.50, y=58.00, z=306.56], EntityEnderman['Enderman'/280, l='MpServer', x=243.50, y=58.00, z=309.53], EntityClientPlayerMP['ForgeDevName'/397, l='MpServer', x=185.90, y=65.62, z=245.27], EntityCow['Cow'/135, l='MpServer', x=120.91, y=70.00, z=221.13], EntitySkeleton['Skeleton'/134, l='MpServer', x=119.06, y=23.00, z=223.63], EntitySkeleton['Skeleton'/258, l='MpServer', x=239.50, y=58.00, z=290.88], EntitySkeleton['Skeleton'/152, l='MpServer', x=130.03, y=37.00, z=234.56], EntityPig['Pig'/259, l='MpServer', x=229.84, y=74.00, z=299.13], EntityCow['Cow'/153, l='MpServer', x=132.63, y=72.00, z=237.47], EntityCreeper['Creeper'/154, l='MpServer', x=140.50, y=14.00, z=252.50], EntityPig['Pig'/256, l='MpServer', x=226.47, y=65.00, z=237.69], EntitySkeleton['Skeleton'/155, l='MpServer', x=137.50, y=14.00, z=251.50], EntityPig['Pig'/257, l='MpServer', x=236.25, y=74.00, z=286.50], EntityZombie['Zombie'/262, l='MpServer', x=228.50, y=30.00, z=314.50], EntitySheep['Sheep'/156, l='MpServer', x=137.50, y=70.00, z=274.66], EntityBat['Bat'/263, l='MpServer', x=229.81, y=55.24, z=304.88], EntityBat['Bat'/260, l='MpServer', x=234.75, y=27.10, z=315.75], EntityZombie['Zombie'/261, l='MpServer', x=230.50, y=29.00, z=316.50], EntitySheep['Sheep'/144, l='MpServer', x=118.50, y=67.00, z=282.81], EntitySheep['Sheep'/145, l='MpServer', x=120.53, y=67.00, z=278.53], EntityPig['Pig'/270, l='MpServer', x=248.16, y=71.00, z=238.03], EntityPig['Pig'/271, l='MpServer', x=248.50, y=71.00, z=242.34], EntitySheep['Sheep'/168, l='MpServer', x=153.84, y=79.00, z=312.50], EntityZombie['Zombie'/163, l='MpServer', x=156.56, y=57.00, z=269.69], EntityBat['Bat'/162, l='MpServer', x=152.36, y=30.50, z=259.59], EntitySpider['Spider'/161, l='MpServer', x=145.38, y=16.00, z=249.72], EntitySquid['Squid'/160, l='MpServer', x=155.25, y=59.38, z=205.50], EntitySheep['Sheep'/167, l='MpServer', x=152.50, y=78.00, z=315.50], EntitySheep['Sheep'/166, l='MpServer', x=155.22, y=79.00, z=312.50], EntitySheep['Sheep'/165, l='MpServer', x=152.47, y=79.00, z=312.50], EntitySpider['Spider'/164, l='MpServer', x=158.16, y=57.00, z=268.59], EntitySquid['Squid'/186, l='MpServer', x=171.51, y=56.00, z=239.53], EntitySquid['Squid'/187, l='MpServer', x=172.50, y=56.00, z=227.26], EntitySquid['Squid'/184, l='MpServer', x=164.50, y=56.00, z=219.75], EntitySquid['Squid'/185, l='MpServer', x=171.47, y=56.35, z=224.71], EntitySpider['Spider'/190, l='MpServer', x=173.38, y=39.00, z=245.72], EntitySquid['Squid'/191, l='MpServer', x=167.66, y=56.34, z=240.97], EntityCreeper['Creeper'/188, l='MpServer', x=162.34, y=16.00, z=247.09], EntitySpider['Spider'/189, l='MpServer', x=175.28, y=39.00, z=245.72], EntityCreeper['Creeper'/179, l='MpServer', x=160.50, y=30.00, z=166.50], EntityCreeper['Creeper'/297, l='MpServer', x=258.50, y=13.00, z=282.84], EntityCreeper['Creeper'/182, l='MpServer', x=174.38, y=32.00, z=185.97], EntitySquid['Squid'/183, l='MpServer', x=170.47, y=56.24, z=223.50], EntityBat['Bat'/181, l='MpServer', x=184.22, y=44.01, z=184.69], EntitySkeleton['Skeleton'/303, l='MpServer', x=265.50, y=16.00, z=294.50], EntityPig['Pig'/205, l='MpServer', x=185.78, y=67.00, z=256.91], EntityPig['Pig'/204, l='MpServer', x=176.88, y=64.00, z=268.19], EntityCreeper['Creeper'/201, l='MpServer', x=182.31, y=18.00, z=187.53], EntitySkeleton['Skeleton'/200, l='MpServer', x=191.50, y=30.00, z=180.50], EntityPig['Pig'/203, l='MpServer', x=195.29, y=67.00, z=250.47], EntitySkeleton['Skeleton'/202, l='MpServer', x=176.63, y=39.00, z=245.69], EntityBat['Bat'/197, l='MpServer', x=179.75, y=45.00, z=175.13], EntitySpider['Spider'/199, l='MpServer', x=189.13, y=30.00, z=180.59], EntityCreeper['Creeper'/198, l='MpServer', x=180.94, y=17.00, z=191.59], EntitySquid['Squid'/192, l='MpServer', x=164.48, y=56.44, z=246.04], EntityBat['Bat'/220, l='MpServer', x=197.09, y=52.76, z=178.68], EntityBat['Bat'/221, l='MpServer', x=191.36, y=18.05, z=202.32], EntityBat['Bat'/222, l='MpServer', x=195.50, y=41.50, z=314.61], EntityZombie['Zombie'/223, l='MpServer', x=203.41, y=12.00, z=325.84], EntityCreeper['Creeper'/216, l='MpServer', x=192.53, y=26.00, z=168.69], EntityCreeper['Creeper'/217, l='MpServer', x=192.41, y=26.00, z=167.78], EntityBat['Bat'/218, l='MpServer', x=195.35, y=52.37, z=174.42], EntityPig['Pig'/239, l='MpServer', x=218.50, y=68.00, z=259.41], EntityPig['Pig'/238, l='MpServer', x=222.53, y=68.00, z=265.31], EntityPig['Pig'/237, l='MpServer', x=216.41, y=64.00, z=246.25], EntityCreeper['Creeper'/236, l='MpServer', x=215.00, y=28.00, z=174.44], EntityCreeper['Creeper'/225, l='MpServer', x=192.41, y=39.00, z=322.50], EntityCreeper['Creeper'/224, l='MpServer', x=205.50, y=23.00, z=321.50], EntityCreeper['Creeper'/255, l='MpServer', x=231.63, y=66.00, z=178.03], EntitySheep['Sheep'/127, l='MpServer', x=112.94, y=68.00, z=187.16], EntityBat['Bat'/244, l='MpServer', x=211.42, y=25.26, z=292.64], EntityBat['Bat'/245, l='MpServer', x=213.81, y=24.69, z=286.01], EntityBat['Bat'/123, l='MpServer', x=107.39, y=48.60, z=178.82], EntitySkeleton['Skeleton'/242, l='MpServer', x=223.44, y=24.00, z=304.09], EntityBat['Bat'/243, l='MpServer', x=219.41, y=26.39, z=295.98], EntityPig['Pig'/240, l='MpServer', x=213.69, y=70.00, z=268.50], EntityBat['Bat'/241, l='MpServer', x=211.73, y=25.83, z=287.41]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:417) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2567) at net.minecraft.client.Minecraft.run(Minecraft.java:983) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at GradleStart.bounce(GradleStart.java:108) at GradleStart.startClient(GradleStart.java:101) at GradleStart.main(GradleStart.java:56) -- System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 8.1 (amd64) version 6.3 Java Version: 1.7.0_65, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 1859098040 bytes (1772 MB) / 2112618496 bytes (2014 MB) up to 2112618496 bytes (2014 MB) JVM Flags: 5 total; -Xincgc -Xmx4G -Xms4G -Xmx2048M -Xms2048M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94 FML: MCP v9.05 FML v7.10.24.1187 Minecraft Forge 10.13.0.1187 4 mods loaded, 4 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available FML{7.10.24.1187} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.0.1187.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Forge{10.13.0.1187} [Minecraft Forge] (forgeSrc-1.7.10-10.13.0.1187.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available progressionplus{1.7.10} [Progression Plus] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Launched Version: 1.7.10 LWJGL: 2.9.1 OpenGL: AMD Radeon HD 8650G GL version 4.4.12967 Compatibility Profile Context 14.200.1004.0, ATI Technologies Inc. GL Caps: Using GL 1.3 multitexturing. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Anisotropic filtering is supported and maximum anisotropy is 16. Shaders are available because OpenGL 2.1 is supported. Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [] Current Language: English (US) Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Anisotropic Filtering: Off (1)
-
[1.7.10]Problem with spawning item entities? Please help
GTRxConfusion replied to GTRxConfusion's topic in Modder Support
woops -
[1.7.10]Problem with spawning item entities? Please help
GTRxConfusion replied to GTRxConfusion's topic in Modder Support
But other than that..? -
[1.7.10]Problem with spawning item entities? Please help
GTRxConfusion replied to GTRxConfusion's topic in Modder Support
package com.gtr.progressionplus.utils; import java.util.ArrayList; import java.util.Random; import java.util.Set; import scala.Console; import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityXPOrb; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.world.World; import net.minecraftforge.event.world.BlockEvent.BreakEvent; import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent; import com.google.common.collect.Sets; import com.gtr.progressionplus.common.ModItems; import com.gtr.progressionplus.enchantment.EnchantInferno; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class IHookContainer { private static final Set exclude = Sets.newHashSet(new Block[] { Blocks.planks, Blocks.bookshelf, Blocks.log, Blocks.log2, Blocks.chest, Blocks.pumpkin, Blocks.lit_pumpkin }); @SuppressWarnings("null") @SubscribeEvent public void breakEvent(HarvestDropsEvent event) { EntityPlayer player = event.harvester; Block mined = event.block; int meta = event.blockMetadata; World world = event.world; int i = event.x; int j = event.y; int k = event.z; Random rand = new Random(); boolean inferno = false; ItemStack itemstack = player.getCurrentEquippedItem(); int infernolvl = getEnchantLevel("inferno", itemstack); if (!player.capabilities.isCreativeMode && !world.isRemote && itemstack != null) { // itemstack.damageItem(1, player); if (itemstack.getItem() instanceof ItemPickaxe) { if (player.isSneaking() == false && infernolvl > 0) { for (ItemStack item : event.drops) { if (FurnaceRecipes.smelting().getSmeltingResult(item) != null) { event.drops.remove(item); ItemStack smelted = FurnaceRecipes.smelting().getSmeltingResult(item); if (smelted.getItem() == Items.iron_ingot || smelted.getItem() == Items.gold_ingot || smelted.getItem() == ModItems.nadium_ingot) { smelted.stackSize = Blocks.diamond_ore.quantityDropped(meta, event.fortuneLevel, rand); } else { smelted.stackSize = mined.quantityDropped(meta, event.fortuneLevel, rand); } event.drops.add(smelted); } else { event.drops.remove(item); item.stackSize = mined.quantityDropped(meta, event.fortuneLevel, rand); event.drops.add(item); } } } } } } public int getEnchantLevel(String name, ItemStack itemstack) { int infernolvl = 0; int fortunelvl = 0; if (itemstack != null) { NBTTagList ench = itemstack.getEnchantmentTagList(); if (ench != null) { for (int x = 0; x < ench.tagCount(); x++) { NBTTagCompound nbt = (NBTTagCompound) (ench).getCompoundTagAt(x); int id = nbt.getInteger("id"); if (id == EnchantInferno.effectid) { infernolvl = nbt.getInteger("lvl"); } if (id == Enchantment.fortune.effectId) { fortunelvl = nbt.getInteger("lvl"); } } } } if (name == "inferno") { return infernolvl; } if (name == "fortune") { return fortunelvl; } return -1; } } any better? sorry my mind is slow and i derp sometimes -
[1.7.10]Problem with spawning item entities? Please help
GTRxConfusion replied to GTRxConfusion's topic in Modder Support
I need fortune to effect smelted ores as well -
[1.7.10]Problem with spawning item entities? Please help
GTRxConfusion replied to GTRxConfusion's topic in Modder Support
should this work? (didnt fully check it yet, as im not completely sure about all of it) package com.gtr.progressionplus.utils; import java.util.ArrayList; import java.util.Random; import java.util.Set; import scala.Console; import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityXPOrb; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.world.World; import net.minecraftforge.event.world.BlockEvent.BreakEvent; import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent; import com.google.common.collect.Sets; import com.gtr.progressionplus.common.ModItems; import com.gtr.progressionplus.enchantment.EnchantInferno; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class IHookContainer { private static final Set exclude = Sets.newHashSet(new Block[] { Blocks.planks, Blocks.bookshelf, Blocks.log, Blocks.log2, Blocks.chest, Blocks.pumpkin, Blocks.lit_pumpkin }); @SuppressWarnings("null") @SubscribeEvent public void breakEvent(HarvestDropsEvent event) { EntityPlayer player = event.harvester; Block mined = event.block; int meta = event.blockMetadata; World world = event.world; int i = event.x; int j = event.y; int k = event.z; boolean inferno = false; int fortune = 0; int level = 0; boolean flag = false; ItemStack itemstack = player.getCurrentEquippedItem(); if (!player.capabilities.isCreativeMode && !world.isRemote && itemstack != null) { // itemstack.damageItem(1, player); if (itemstack.getItem() instanceof ItemPickaxe) { if (player.isSneaking() == false) { ArrayList<ItemStack> before = event.drops; event.drops.clear(); event.drops.addAll(inferno(world, player, meta, mined, i, j, k,before)); } } event.setCanceled(flag); } } @SuppressWarnings("null") private ArrayList<ItemStack> inferno(World world, EntityPlayer player, int meta, Block mined, int i, int j, int k, ArrayList<ItemStack> before) { ItemStack itemstack = player.getCurrentEquippedItem(); boolean inferno = false; int fortune = getEnchantLevel("fortune", itemstack); int level = getEnchantLevel("inferno", itemstack); ArrayList<ItemStack> todrop = new ArrayList(); if (fortune == -1) { fortune = 0; } if (level == -1) { level = 0; } Random rand = new Random(); if (level > 0) inferno = true; if (inferno) { if (!world.isRemote) { if (before != null && before.size() > 0) { for (ItemStack item : before) { if (FurnaceRecipes.smelting().getSmeltingResult(item) != null) { ItemStack smelted = FurnaceRecipes.smelting().getSmeltingResult(item); if (smelted.getItem() == Items.iron_ingot || smelted.getItem() == Items.gold_ingot || smelted.getItem() == ModItems.nadium_ingot) { smelted.stackSize = Blocks.diamond_ore.quantityDropped(meta, fortune, rand); } else { smelted.stackSize = mined.quantityDropped(meta, fortune, rand); } todrop.add(smelted); } else { item.stackSize = mined.quantityDropped(meta, fortune, rand); todrop.add(item); } } return todrop; } world.setBlock(i, j, k, Blocks.air); return todrop; } } return todrop; } public int getEnchantLevel(String name, ItemStack itemstack) { int infernolvl = 0; int fortunelvl = 0; if (itemstack != null) { NBTTagList ench = itemstack.getEnchantmentTagList(); if (ench != null) { for (int x = 0; x < ench.tagCount(); x++) { NBTTagCompound nbt = (NBTTagCompound) (ench).getCompoundTagAt(x); int id = nbt.getInteger("id"); if (id == EnchantInferno.effectid) { infernolvl = nbt.getInteger("lvl"); } if (id == Enchantment.fortune.effectId) { fortunelvl = nbt.getInteger("lvl"); } } } } if (name == "inferno") { return infernolvl; } if (name == "fortune") { return fortunelvl; } return -1; } } -
[1.7.10]Problem with spawning item entities? Please help
GTRxConfusion replied to GTRxConfusion's topic in Modder Support
Ah, ok. Thanks -
[1.7.10]Problem with spawning item entities? Please help
GTRxConfusion replied to GTRxConfusion's topic in Modder Support
This code is to get my enchant to work with fortune, so yes diamonds should be dropped. but not 7, as the max amount of diamonds that would ever drop on fortune 3 with diamond ore is 4. How do i use harvestdrops? Edit: should i have my inferno method return a list of items? and have the event use those items? -
[1.7.10]Problem with spawning item entities? Please help
GTRxConfusion replied to GTRxConfusion's topic in Modder Support
Well could you help with something else possibly? I thought i figured out a bug in my code but i guess not. I just broke a diamond ore with a fortune 3 + inferno pick and got 7 diamonds. any help? and im pretty sure this does this for all ores -
[1.7.10]Problem with spawning item entities? Please help
GTRxConfusion replied to GTRxConfusion's topic in Modder Support
Ok, thanks. I understand, but im confused since if i break 3 blocks and their stacks merge together i pick up 2 items? if they were all using the same reference wouldnt i still only get 2? Edit: Meant for the second '2' to be a '1'. sorry -
Im trying to work on my autosmelt enchant, and im trying to get it to work with fortune. Whenever i break a smeltable block with a pick that has my enchant but not fortune, it drops an item just fine, but if i dont pick that item up and break another block the second item drops, and as usual, the stacks merge, but when i go to pick up the stack of two on the ground i only get one item and not two. heres my code package com.gtr.progressionplus.utils; import java.util.ArrayList; import java.util.Random; import java.util.Set; import scala.Console; import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityXPOrb; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.world.World; import net.minecraftforge.event.world.BlockEvent.BreakEvent; import com.google.common.collect.Sets; import com.gtr.progressionplus.common.ModItems; import com.gtr.progressionplus.enchantment.EnchantInferno; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class IHookContainer { private static final Set exclude = Sets.newHashSet(new Block[] { Blocks.planks, Blocks.bookshelf, Blocks.log, Blocks.log2, Blocks.chest, Blocks.pumpkin, Blocks.lit_pumpkin }); @SuppressWarnings("null") @SubscribeEvent public void breakEvent(BreakEvent event) { EntityPlayer player = event.getPlayer(); Block mined = event.block; int meta = event.blockMetadata; World world = event.world; int i = event.x; int j = event.y; int k = event.z; boolean inferno = false; int fortune = 0; int level = 0; boolean flag = false; ItemStack itemstack = player.getCurrentEquippedItem(); if (!player.capabilities.isCreativeMode && !world.isRemote && itemstack != null) { // itemstack.damageItem(1, player); if (itemstack.getItem() instanceof ItemPickaxe) { if (player.isSneaking() == false) { flag = inferno(world, player, meta, mined, i, j, k); } } event.setCanceled(flag); } } @SuppressWarnings("null") private boolean inferno(World world, EntityPlayer player, int meta, Block mined, int i, int j, int k) { ItemStack itemstack = player.getCurrentEquippedItem(); boolean inferno = false; int fortune = getEnchantLevel("fortune", itemstack); int level = getEnchantLevel("inferno", itemstack); if (fortune == -1) { fortune = 0; } if (level == -1) { level = 0; } Random rand = new Random(); if (level > 0) inferno = true; if (inferno) { ArrayList<ItemStack> items = mined.getDrops(world, i, j, k, meta, fortune); { } ArrayList<ItemStack> todrop = new ArrayList(); if (!world.isRemote) { if (items != null && items.size() > 0) { for (ItemStack item : items) { if (FurnaceRecipes.smelting().getSmeltingResult(item) != null) { ItemStack smelted = FurnaceRecipes.smelting().getSmeltingResult(item); if (smelted.getItem() == Items.iron_ingot || smelted.getItem() == Items.gold_ingot || smelted.getItem() == ModItems.nadium_ingot) { smelted.stackSize = Blocks.diamond_ore.quantityDropped(meta, fortune, rand); } else { smelted.stackSize = mined.quantityDropped(meta, fortune, rand); } todrop.add(smelted); } else { item.stackSize = mined.quantityDropped(meta, fortune, rand); todrop.add(item); } } if (todrop.size() > 0) { float f = 0.7F; double d0 = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D; double d1 = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D; double d2 = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D; for (ItemStack item : todrop) { EntityItem entityitem = new EntityItem(world, (double) i + d0, (double) j + d1, (double) k + d2, item); entityitem.delayBeforeCanPickup = 10; world.spawnEntityInWorld(entityitem); } } } world.setBlock(i, j, k, Blocks.air); return true; } } return false; } public int getEnchantLevel(String name, ItemStack itemstack) { int infernolvl = 0; int fortunelvl = 0; if (itemstack != null) { NBTTagList ench = itemstack.getEnchantmentTagList(); if (ench != null) { for (int x = 0; x < ench.tagCount(); x++) { NBTTagCompound nbt = (NBTTagCompound) (ench).getCompoundTagAt(x); int id = nbt.getInteger("id"); if (id == EnchantInferno.effectid) { infernolvl = nbt.getInteger("lvl"); } if (id == Enchantment.fortune.effectId) { fortunelvl = nbt.getInteger("lvl"); } } } } if (name == "inferno") { return infernolvl; } if (name == "fortune") { return fortunelvl; } return -1; } }
-
[1.7.10]Custom techne model wont render
GTRxConfusion replied to GTRxConfusion's topic in Modder Support
Turns out i was doing renderAsNormalCube instead of renderAsNormalBlock. Even though i fixed this the block still isnt rendering. Can anyone help please? -
So im trying to get a custom techne model to render as a block, but it just wont. Heres my code, can someone help me figure this out? The block is in the game its just invisible, and theres particles when i break it. BasicRenderer.java package com.gtr.progressionplus.render; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import scala.Console; import com.gtr.progressionplus.common.References; import com.gtr.progressionplus.model.ModelExtension; import com.gtr.progressionplus.model.ObsidianForge; public class BasicRenderer extends TileEntitySpecialRenderer { private ModelExtension model; public static ResourceLocation texture; public BasicRenderer(ModelExtension model, ResourceLocation texture) { this.model = model; this.texture = texture; } @Override public void renderTileEntityAt(TileEntity entity, double x, double y, double z, float f1) { GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glRotatef(180, 0, 0, 1); this.bindTexture(texture); GL11.glPushMatrix(); this.model.renderModel(0.0625f); GL11.glPopMatrix(); GL11.glPopMatrix(); } } ModBlocks.java package com.gtr.progressionplus.common; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import com.gtr.progressionplus.ProgressionPlus; import com.gtr.progressionplus.block.MeteoriteOre; import com.gtr.progressionplus.block.ObsidianForgeBlock; import com.gtr.progressionplus.block.SimpleBlock; import com.gtr.progressionplus.block.SimpleOre; import com.gtr.progressionplus.block.entity.ObsidianForgeEntity; import cpw.mods.fml.common.registry.GameRegistry; public class ModBlocks { public static Block compressed_obsidian; public static SimpleOre meteorite_ore; public static SimpleOre nadium_ore; public static Block obsidian_forge; public static void Add() { compressed_obsidian = new SimpleBlock(Material.rock, 55.0F, 2250.0F).setBlockName("compressedObsidian").setStepSound(Block.soundTypePiston).setBlockTextureName("obsidian"); compressed_obsidian.setHarvestLevel("pickaxe", 3); meteorite_ore = (MeteoriteOre) new MeteoriteOre().setBlockName("oreMeteorite").setHardness(6.0F).setResistance(350.0F).setStepSound(Block.soundTypeStone).setBlockTextureName("progressionplus:meteorite_ore"); meteorite_ore.setHarvestLevel("pickaxe", 2); ((SimpleOre) meteorite_ore).setItemDrop(ModItems.meteorite_chunk); nadium_ore = (SimpleOre) new SimpleOre().setBlockName("oreNadium").setHardness(4.0F).setResistance(250.0F).setStepSound(Block.soundTypeStone).setBlockTextureName("diamond_ore"); nadium_ore.setHarvestLevel("pickaxe", 3); nadium_ore.setBlockDrop(nadium_ore); obsidian_forge = new ObsidianForgeBlock(Material.rock).setCreativeTab(ProgressionPlus.tabProgressionPlus); Register(); } public static void Register() { GameRegistry.registerBlock(compressed_obsidian, "compressed_obsidian"); GameRegistry.registerBlock(nadium_ore, "nadium_ore"); GameRegistry.registerBlock(meteorite_ore, "ore_meteorite"); GameRegistry.registerBlock(obsidian_forge, "obsidian_forge"); GameRegistry.registerTileEntity(ObsidianForgeEntity.class, "obsidian_forge_entity"); } } ObsidianForgeBlock.java package com.gtr.progressionplus.block; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import com.gtr.progressionplus.block.entity.ObsidianForgeEntity; public class ObsidianForgeBlock extends Block { public ObsidianForgeBlock(Material material) { super(material); this.setHardness(20f); this.setResistance(20f); } public TileEntity createNewTileEntity(World world, int par2) { return new ObsidianForgeEntity(); } public int getRenderType() { return -1; } public boolean renderAsNormalCube() { return false; } public boolean isOpaqueCube() { return false; } } ObsidianForge.java (the model) package com.gtr.progressionplus.model; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class ObsidianForge extends ModelExtension { //fields ModelRenderer Main_Furnace_Body; ModelRenderer Shape1; ModelRenderer Shape2; public ObsidianForge() { textureWidth = 64; textureHeight = 64; Main_Furnace_Body = new ModelRenderer(this, 0, 0); Main_Furnace_Body.addBox(0F, 14F, 7F, 16, 10, 16); Main_Furnace_Body.setRotationPoint(-8F, 0F, -15F); Main_Furnace_Body.setTextureSize(64, 64); Main_Furnace_Body.mirror = true; setRotation(Main_Furnace_Body, 0F, 0F, 0F); Shape1 = new ModelRenderer(this, 0, 26); Shape1.addBox(-7F, 13F, -15F, 14, 2, 16); Shape1.setRotationPoint(0F, -1F, 7F); Shape1.setTextureSize(64, 64); Shape1.mirror = true; setRotation(Shape1, 0F, 0F, 0F); Shape2 = new ModelRenderer(this, 0, 44); Shape2.addBox(-5F, 11F, -8F, 10, 1, 16); Shape2.setRotationPoint(0F, 0F, 0F); Shape2.setTextureSize(64, 64); Shape2.mirror = true; setRotation(Shape2, 0F, 0F, 0F); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5,entity); Main_Furnace_Body.render(f5); Shape1.render(f5); Shape2.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void renderModel(float f) { Main_Furnace_Body.render(f); Shape1.render(f); Shape2.render(f); } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); } } and my init method @EventHandler public void preInit(FMLInitializationEvent event) { OreGeneration ore_gen = new OreGeneration(); GameRegistry.registerWorldGenerator(ore_gen, 0); ModItems.Add(); ModBlocks.Add(); ModRecipes.Add(); GameRegistry.registerFuelHandler(new SimpleFuelHandler()); proxy.registerRenderers(); MinecraftForge.EVENT_BUS.register(new IHookContainer()); System.out.println("Progression Plus has pre-initialized!"); } thanks in advance to anyone who helps EDIT: And ModelExtension.java package com.gtr.progressionplus.model; import net.minecraft.client.model.ModelBase; public class ModelExtension extends ModelBase { public void renderModel(float f) { } }