Everything posted by Anon10W1z
-
Access Transformer not working?
Use reflection. Access transformers are useless.
-
Error when adding dataWatcher objects from another class
Side note, don't use Byte.valueOf.
-
[SOLVED] finding a recipe and deleting it.
Your mod may be getting loaded after BuildCraft...try adding dependencies = "after:*" To your @Mod declaration. Replace the * with BuildCraft's mod id.
-
How to get the EntityPlayerMP from the command sender
Sorry but I couldn't help but notice your username. Reddit?
-
[1.8] Any way to make vanilla dirt a falling block?
Alright, I will
-
How do I implement IFuelHandler?
I prefer to keep it on one line.
-
[1.8] Any way to make vanilla dirt a falling block?
Nope, I put the name of the new block and the object of the old block, just like it said in the Javadoc. BlockNewDirt extends BlockDirt.
-
How do I implement IFuelHandler?
You can also use multiple items in one handler. return fuel.getItem() == YourMod.firstItem ? burnTime * 20 : (fuel.getItem() == YourMod.secondItem ? secondBurnTime * 20 : 0) : 0;
-
How do I implement IFuelHandler?
public class MyFuelHandler implements IFuelHandler { public int getBurnTime(ItemStack fuel) { return fuel.getItem() == YourMod.yourItem ? burnTimeInSeconds * 20 : 0; } } Seriously, it's not that hard. I was in a good mood.
-
[1.7.10] EventHandlers not loading
do MinecraftForge.EVENT_BUS.register with your handlers as well
-
[1.7.10] Autosmelt For Tools?
A while ago I found this https://github.com/SlimeKnights/TinkersConstruct/blob/4a5757bf1fe23dc9b1e652db628417c6b6fe9317/src/tconstruct/modifiers/TActiveOmniMod.java See the second method.
-
[1.8] Any way to make vanilla dirt a falling block?
OK, I tried a reflection-hack method: System.out.println(replaceBlock(Blocks.dirt, falling_dirt)); public static boolean replaceBlock(Block toReplace, Block newBlock) { Field modifiersField; try { modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); for (Field field : Blocks.class.getDeclaredFields()) { if (Block.class.isAssignableFrom(field.getType())) { Block block = (Block) field.get(null); if (block == toReplace) { String registryName = Block.blockRegistry.getNameForObject(block).toString(); int id = Block.getIdFromBlock(block); ItemBlock item = (ItemBlock) Item.getItemFromBlock(block); System.out.println("Replacing block - " + id + "/" + registryName); FMLControlledNamespacedRegistry<Block> registry = GameData.getBlockRegistry(); registry.putObject(registryName, newBlock); Field map = RegistryNamespaced.class.getDeclaredFields()[0]; map.setAccessible(true); ((ObjectIntIdentityMap) map.get(registry)).put(newBlock, id); map = FMLControlledNamespacedRegistry.class.getDeclaredField("persistentSubstitutions"); map.setAccessible(true); ((BiMap) map.get(registry)).put(registryName, id); field.setAccessible(true); int modifiers = modifiersField.getInt(field); modifiers &= ~Modifier.FINAL; modifiersField.setInt(field, modifiers); field.set(null, newBlock); Field itemblock = ItemBlock.class.getDeclaredFields()[0]; itemblock.setAccessible(true); modifiers = modifiersField.getInt(itemblock); modifiers &= ~Modifier.FINAL; modifiersField.setInt(itemblock, modifiers); itemblock.set(item, newBlock); System.out.println("Check field: " + field.get(null).getClass()); System.out.println("Check registry: " + Block.blockRegistry.getObjectById(id).getClass()); System.out.println("Check item: " + ((ItemBlock) Item.getItemFromBlock(block)).block.getClass()); } } } } catch (Exception e) { e.printStackTrace(); return false; } return true; } This gives the output: [11:17:56] [Client thread/INFO] [sTDOUT]: [com.anon10w1z.craftPP.blocks.CppBlocks:replaceBlock:62]: Replacing block - 3/minecraft:dirt [11:17:56] [Client thread/WARN] [FML]: **************************************** [11:17:56] [Client thread/WARN] [FML]: * Ignoring putObject(minecraft:dirt, com.anon10w1z.craftPP.blocks.BlockFallingDirt@3efcf4dd), adding alias to craft++:falling_dirt instead [11:17:56] [Client thread/WARN] [FML]: * at net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry.putObject(FMLControlledNamespacedRegistry.java:158) [11:17:56] [Client thread/WARN] [FML]: * at com.anon10w1z.craftPP.blocks.CppBlocks.replaceBlock(CppBlocks.java:65) [11:17:56] [Client thread/WARN] [FML]: * at com.anon10w1z.craftPP.blocks.CppBlocks.registerBlocks(CppBlocks.java:45) [11:17:56] [Client thread/WARN] [FML]: * at com.anon10w1z.craftPP.main.CraftPlusPlus.onPreInit(CraftPlusPlus.java:87) [11:17:56] [Client thread/WARN] [FML]: * at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [11:17:56] [Client thread/WARN] [FML]: * at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)... [11:17:56] [Client thread/WARN] [FML]: **************************************** [11:17:56] [Client thread/INFO] [sTDOUT]: [com.anon10w1z.craftPP.blocks.CppBlocks:replaceBlock:88]: Check field: class com.anon10w1z.craftPP.blocks.BlockFallingDirt [11:17:56] [Client thread/INFO] [sTDOUT]: [com.anon10w1z.craftPP.blocks.CppBlocks:replaceBlock:89]: Check registry: class com.anon10w1z.craftPP.blocks.BlockFallingDirt [11:17:56] [Client thread/INFO] [sTDOUT]: [com.anon10w1z.craftPP.blocks.CppBlocks:replaceBlock:90]: Check item: class com.anon10w1z.craftPP.blocks.BlockFallingDirt true [11:17:56] [Client thread/INFO] [craft++]: Pre-initialization completed successfully [11:17:56] [Client thread/INFO] [FML]: Applying holder lookups [11:17:56] [Client thread/INFO] [FML]: Holder lookups applied [11:17:57] [sound Library Loader/INFO]: Starting up SoundSystem... [11:17:57] [Thread-7/INFO]: Initializing LWJGL OpenAL [11:17:57] [Thread-7/INFO]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) [11:17:57] [Thread-7/INFO]: OpenAL initialized. [11:17:57] [sound Library Loader/INFO]: Sound engine started [11:17:58] [Client thread/WARN]: Unable to load definition craft++:falling_dirt#snowy=false,variant=dirt java.lang.RuntimeException: Encountered an exception when loading model definition of model craft++:blockstates/falling_dirt.json //no model exists currently [11:17:59] [Client thread/INFO]: Created: 512x512 textures-atlas [11:18:00] [Client thread/WARN]: Missing model for: craft++:item/falling_dirt [11:18:00] [Client thread/INFO] [craft++]: Registering the block inventory renderers [11:18:00] [Client thread/INFO] [craft++]: Registering the event handler [11:18:00] [Client thread/INFO] [craft++]: Registering the fuel handler [11:18:00] [Client thread/INFO] [craft++]: Registering the crafting/furnace recipes [11:18:00] [Client thread/INFO] [craft++]: Registering the dispenser behaviors [11:18:00] [Client thread/INFO] [craft++]: Registering dispenser behavior for Sand/Red Sand [11:18:00] [Client thread/INFO] [craft++]: Registering dispenser behavior for Gravel [11:18:00] [Client thread/INFO] [craft++]: Registering dispenser behavior for Block of Sugar [11:18:00] [Client thread/INFO] [craft++]: Registering default dispenser behavior for Flint and Steel [11:18:00] [Client thread/INFO] [craft++]: Initializing the vanilla properties changer [11:18:00] [Client thread/INFO] [craft++]: Initializing the crafting recipe remover [11:18:00] [Client thread/INFO] [craft++]: Replacing stone tool recipes [11:18:00] [Client thread/INFO] [craft++]: Replacing stairs recipes [11:18:00] [Client thread/INFO] [craft++]: Replacing vanilla button recipes [11:18:00] [Client thread/INFO] [craft++]: Removing tool repair recipes [11:18:00] [Client thread/INFO] [craft++]: Initialization completed successfully [11:18:00] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:568]: ---- Minecraft Crash Report ---- // You're mean. Time: 2/16/15 11:18 AM Description: Initializing game java.lang.IllegalStateException: Registry entry for ItemBlock net.minecraft.item.ItemBlock@6e88c81e, id 201, is missing or uses the non-matching id 3. at net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry.validateContent(FMLControlledNamespacedRegistry.java:88)
-
How to show chat messsages
player.addChatMessage(new ChatComponentText("Learn Java."));
-
[1.8] Any way to make vanilla dirt a falling block?
It's OK.
-
[1.8] Any way to make vanilla dirt a falling block?
I removed the GameRegistry.registerBlock call but now it crashes with: java.lang.NullPointerException: The replacement target is not present. This won't work at net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry.addSubstitutionAlias(FMLControlledNamespacedRegistry.java:492) at net.minecraftforge.fml.common.registry.GameData.registerSubstitutionAlias(GameData.java:920) at net.minecraftforge.fml.common.registry.GameRegistry.addSubstitutionAlias(GameRegistry.java:161) at com.anon10w1z.craftPP.blocks.CppBlocks.registerBlocks(CppBlocks.java:38) at com.anon10w1z.craftPP.main.CraftPlusPlus.onPreInit(CraftPlusPlus.java:87) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606)
-
[1.8] Any way to make vanilla dirt a falling block?
No, but you can extend one and insert the duplicated necessary methods of the other. True, true...I guess I can. EDIT: Nope, I still get the error: [18:47:56] [Client thread/ERROR] [FML]: The substitute net.minecraft.block.BlockDirt for craft++:dirt (type com.anon10w1z.craftPP.blocks.BlockNewDirt) is type incompatible. This won't work [18:47:56] [Client thread/INFO] [FML]: Applying holder lookups [18:47:56] [Client thread/INFO] [FML]: Holder lookups applied [18:47:56] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from PREINITIALIZATION to INITIALIZATION. Loading cannot continue [18:47:56] [Client thread/ERROR] [FML]: mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized FML{8.0.20.1290} [Forge Mod Loader] (forgeSrc-1.8-11.14.0.1290-1.8.jar) Unloaded->Constructed->Pre-initialized Forge{11.14.0.1290} [Minecraft Forge] (forgeSrc-1.8-11.14.0.1290-1.8.jar) Unloaded->Constructed->Pre-initialized craft++{2.1} [Craft++] (main) Unloaded->Constructed->Errored [18:47:56] [Client thread/ERROR] [FML]: The following problems were captured during this phase [18:47:56] [Client thread/ERROR] [FML]: Caught exception from craft++ net.minecraftforge.fml.common.registry.IncompatibleSubstitutionException at net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry.addSubstitutionAlias(FMLControlledNamespacedRegistry.java:497) ~[forgeSrc-1.8-11.14.0.1290-1.8.jar:?] at net.minecraftforge.fml.common.registry.GameData.registerSubstitutionAlias(GameData.java:920) ~[forgeSrc-1.8-11.14.0.1290-1.8.jar:?] at net.minecraftforge.fml.common.registry.GameRegistry.addSubstitutionAlias(GameRegistry.java:161) ~[forgeSrc-1.8-11.14.0.1290-1.8.jar:?] at com.anon10w1z.craftPP.blocks.CppBlocks.registerBlocks(CppBlocks.java:34) ~[main/:?] at com.anon10w1z.craftPP.main.CraftPlusPlus.onPreInit(CraftPlusPlus.java:87) ~[main/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_55] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_55] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_55] at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_55]
-
[1.8] Any way to make vanilla dirt a falling block?
I would use it, however, they must be type compatible. I cannot extend both BlockDirt and BlockFalling ;(
-
[1.8] Any way to make vanilla dirt a falling block?
I am not quite sure there is a way to remove blocks from the block registry.
-
[1.7.10] World spawn point keeps resetting
Side note, you spelled Satellite wrong.
-
[1.8] Any way to make vanilla dirt a falling block?
Sadly, I believe this will require ASM, but I was wondering if I could use at worst reflection, which I am comfortable with, or some other method to replace the vanilla dirt block with my own? There is no way I could use events, right?
-
[1.7.10] Run a command.
MinecraftServer.getServer().getCommandManager().executeCommand(player, command);
-
[1.7.10+] EntityMounted and EntityDismounted events.
Nice idea. I fully support!
-
[1.7.10] Removing a line of chat from the client
What's the crash report?
-
[1.7.10]How would I check if an item is on the ground?
Is there the possibility of multiple objects in the array? If not, then that's fine.
-
[1.7.10]How would I check if an item is on the ground?
Thats a really good idea. It works. Thanks! No problem, glad I could help!
IPS spam blocked by CleanTalk.