
shieldbug1
Forge Modder-
Posts
404 -
Joined
-
Last visited
Everything posted by shieldbug1
-
[1.7.10] LeaveBlock don't render if set behind another
shieldbug1 replied to SantacreeperLP's topic in Modder Support
Please use the [ code ] tags (without the spaces) to make it easier to read. Now there are a few things I don't get here: @SideOnly(Side.CLIENT) public int aaA; @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int metadata) { for (int i = 0; i < 2; ++i) { aaA = i; } return field_150129_M[(!isOpaqueCube() ? 0 : 1)] [aaA]; } Is identical to @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { return field_150129_M[0][1]; } Next: public void registerBlockIcons(IIconRegister iconRegister) { field_150129_M = new IIcon[2][2]; for (int i = 0; i < 2; ++i) { field_150129_M[0] = iconRegister.registerIcon(CurrentMainClass.MODID + ":" + "waterinvolved_leaves"); field_150129_M[1] = iconRegister.registerIcon(CurrentMainClass.MODID + ":" + "waterinvolved_leaves_opaque"); } } What does this for-loop even do? You're instantiating indexes 0 an 1 in your array twice to the exact same thing. Apart from that field_150129_M is an IIcon[][] (double array). So field_150129_M[0] and field_150129_M[1] are actually arrays themselves. These things might be the cause of your problems, though I don't know. I also suggest cleaning up all of your local variables and renaming to readable things (p_SOMENUMBER_SOMELETTER is not understandable, and very hard to debug). -
I've made a library/utility mod that all my other mods depend on because I don't like having so much duplicate code. Now I created a sort of 'Dummy' mod class (a class annotated with @Mod) so that I can still hook into the @EventHandler events, as well as use the 'dependencies' functionality of @Mod. I don't really think it's necessary for this dummy mod to be shown in the 'Mods' screen (from the game menu). What would be the best way to approach this?
-
Can't Reply to Some Non-Locked Topics
shieldbug1 replied to Eternaldoom's topic in General Discussion
I can confirm this also happens to me on that thread, using Google Chrome. -
Forge is not downloading when I install it
shieldbug1 replied to scanax's topic in Support & Bug Reports
-
I haven't messed with them yet, but you can try playing around with the new PlaceEvent (or maybe MultiPlaceEvent?).
-
I believe the constructor for ResourceLocation takes in two arguments, domain (usually ModID), and then the location. So it should look like: new ResourceLocation(MODID, LOCATION);
-
Can't Reply to Some Non-Locked Topics
shieldbug1 replied to Eternaldoom's topic in General Discussion
Could you link an example? I have never noticed this. -
[Solved] [1.7.10] Modeling an Item with Metadata
shieldbug1 replied to Whyneb360's topic in Modder Support
I haven't done any rendering, but it looks like your switch statement is falling through. That could be it, maybe? -
Whatever you return in onMessage should be the reply if you need one. Otherwise return null.
-
You don't even have to mess with packets themseles. Diesieben has an incredibly simple to understand tutorial on how to use the SimpleNetworkWrapper.
-
Eclipse Says, "Could not find or load main class GradleStart"
shieldbug1 replied to Draco18s's topic in ForgeGradle
Did you run gradlew eclipse setupDecompWorkspace gives you the source, while Dev doesn't. (http://prntscr.com/4ti9oi straight from running the command 'gradlew tasks' - as you can see, setupDecompWorkspace does CI + Dev + source). Running gradlew eclipse "generates all Eclipse files". -
You can't save a tileEntity by itself, however you can do this: SomeTileEntity tileEntity = ......; NBTTagCompound compound = new NBTTagCompound(); tileEntity.writeToNBT(compound); Then later, to get the tileEntity back NBTTagCompound compound = //retrieve the compound SomeTileEntity tileEntity = new SomeTileEntity(); tileEntity.readFromNBT(compound);
-
Eclipse Says, "Could not find or load main class GradleStart"
shieldbug1 replied to Draco18s's topic in ForgeGradle
Try running the setupDecompWorkspace and eclipse ForgeGradle commands again. -
[SOLVED ]Getting Damage Source type and Damage Source Vector
shieldbug1 replied to kitsushadow's topic in Modder Support
Check the class of the entity. If you want to only affect vanilla entities then check the class itself, otherwise just use instanceof. -
I don't know if a IMessage can be its own IMessageHandler (I think I saw a pull for this get rejected on github). Rather than having your MessageIronNote class implement IMessageHandler directly, try having a static nested class implement it instead. public final class MyMessage implements IMessage { //IMessage code ... public static final class Handler implements IMessageHandler<MyMessage, IMessage> { //Handler code ... } } And registering like this: INSTANCE.registerMessage(MyMessage.Handler.class, MyMessage.class, id++, Side.SERVER);
-
Modding tutorial vids for making a dimension [1.7.10]
shieldbug1 replied to KingYoshiYT's topic in Modder Support
If you're looking for copy-paste ready code, you won't find it here. -
[1.8] setHardness, setResistance, setStepSound are "protected"!?
shieldbug1 replied to MrJPGames's topic in Modder Support
Call them from the Block's constructor. public final class SomeBlock extends Block { public SomeBlock() { super(Material.rock); setHardness(1.0F); } } To be honest, the block class shouldn't be treated as a 'Builder' class, and those methods should be void rather than 'chaining'. -
Your checkUpdate method needs to have an @EventHandler annotation, not a @SubscribeEvent one.
-
I want something to be initialized when a player joins the game.
shieldbug1 replied to yhflab's topic in Modder Support
What do you want to do? You can use the PlayerLoggedInEvent, EntityConstructing and EntityJoinWorldEvent events, in conjunction with PlayerChangedDimensionEvent and PlayerEvent.Clone if you need to keep stuff over deaths and dimension changes or whatever. -
[SOLVED] Giving Items Right Click Abilities
shieldbug1 replied to kitsushadow's topic in Modder Support
First of all, max and min values are fields, not methods. You do not use brackets. Second, they're all CAPS like MAX_VALUE. Lastly, because the 'wildcard value' changes (it used to be -1 I think) you use OreDictionary.WILDCARD_VALUE. Anyway, to compare items just use ItemStack#getItem and then compare the reference, since there is only one instance of your item at a time. -
[1.7.2]Dedicated Server Crash[Solved{for now}]
shieldbug1 replied to hugo_the_dwarf's topic in Modder Support
You're using the Minecraft class, which is Client only. You need to move your code into your client proxy, so that on message method should like like public IMessage onMessage(SomeMessage message, MessageContext ctx) { return MainMod.proxy.handleSomeMessage(message, ctx); } And then you create that method in client and server proxy, and just return null and do nothing on the server. Even though the message is sent from the server and only handled on the client, the server still needs to know about this class. -
how can i get the entityplayer from icommandsender
shieldbug1 replied to yhflab's topic in Modder Support
ICommadSender is an interface implemented by EntityPlayer (or it's subclasses, I can't remember). if(someCommandSender instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) someCommandSender; } -
Are there any errors when running the gradle commands? Try running gradlew clean and then setupDecompWorkspace and eclipse again.
-
TileEntity data saving on server but not on client.
shieldbug1 replied to 9903286's topic in Modder Support
You need to override the method onDescriptionPacket (or whatever the method is called, I forget) in your TileEntity class, and call readFromNBT from the NBTTagCompound you get from the Packet in the parameters of the method. Alternatively you can use the Simple Network Wrapper to update values between Client and Server. You can look at Pahimar's GitHub repository for EE3 as an example on how to do this properly.