Posts posted by Cadiboo
-
-
-
The player interact event has a few subclasses that do what you want.
-
-
-
-
2 hours ago, Torq said:
Do I have to do this for every class in net.minecraft.block?
package torq.torqmod.block; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockOre; import net.minecraft.block.state.IBlockState; import net.minecraft.util.IItemProvider; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.common.ToolType; /** * * * @author torq * @version 0.1 */ public class ModBlockOre extends BlockOre { public int harvestLevel = 3; public ToolType toolType = ToolType.PICKAXE; public ModBlockOre(Block.Properties builder) { super(builder); } @Override public IItemProvider getItemDropped(IBlockState state, World worldIn, BlockPos pos, int fortune) { return (IItemProvider) this; } @Override public int quantityDropped(IBlockState state, Random random) { return 1; } @Override public int getHarvestLevel(IBlockState state) { return harvestLevel; } @Override public ToolType getHarvestTool(IBlockState state) { return toolType; } }
No. Can you please clarify what you’re trying to do again?
-
-
-
-
-
2 hours ago, LaDestitute said:
with the format of Thing#thing, the latter thing (such as TileEntity#getPos) refers to a method classed under that class, right?
It’s in the format
Class#instanceThing (Field or method)
or
Class#instanceMethod(args).
You might also see people use the format
Class::method
which means a static or instance method
-
12 minutes ago, LaDestitute said:
ContainerBase (which implements BlockContainer)
Don’t extend BlockContainer, it’s legacy vanilla code. Simply override Block#hasTileEntity(IBlockState) and Block#createTileEntity(IBlockState)
12 minutes ago, LaDestitute said:How do I get it to auto-trigger if any entity walks up to seven blocks away from it's south-face (if that's possible or if it's a limit of one block?), while accounting for blocks blocking line of sight (a block blocking in any portion of the range of line = no activation)? I have a hunch I'd have to use raytracing, probably, right? Not gonna post my TE code cause it's 95% vanilla code.
Tickable tile entities can do whatever they want in their onUpdate method (renamed tick in 1.13). You can use TileEntity#getPos, BlockPos#offset(EnumFacing, int), AxisAlignedBB(BlockPos) and World#getEntitiesInsideAABB to find all entities up to 7 blocks away from your TE in any direction. As a general rule, don’t copy the vanilla code exactly, it’s usually not very good (vanilla operates in an “if it ain’t broke don’t fix it” way) and Forge usually has better ways of doing what you want. That said, vanilla is an excellent reference, but it’s not great to just copy paste vanilla code.
16 minutes ago, LaDestitute said:due to how my mod registers blocks/items (with a static list and "ModBlocks.BLOCKS.add(this);" and "ModItems.ITEMS.add(new ItemBlock(this).setRegistryName(this.getRegistryName()));" ), it kind of breaks the blockstates for my trap and the constructor/constructor values like Hardness.
This likely means you followed a sub-par YouTube tutorial about how to setup your mod. Don’t use static initialisers (see http://www.minecraftforge.net/forum/topic/70095-1122-custom-tree-problems/?do=findComment&comment=339598 for an explanation), your registration can be massively simplified and clean up (see https://gist.github.com/Cadiboo/b825d62fb46538e7b7b262c5612d62aa and https://gist.github.com/Cadiboo/3f5cdb785affc069af2fa5fdf2d70358)
-
2 hours ago, Torq said:
I can override Block and rewrite everything else, inheriting from Block, but then ModBlockGlowstone! = BlockGlowstone, although they will be exactly the same. That's why I say that I will have to override every class in net.minecraft.block
BlockGlowstone inherits the method from Block because it extends it. You can override it just fine while still extending BlockGlowstone
-
13 minutes ago, TheRPGAdventurer said:
deleting .git
.git contains all the information about your local repository including all the data about your files that is used to build the diffs that git works with when you push changes. I suggest that you save your current progress locally by moving your src folder (and everything else you changed) to another folder (your desktop is a good place) and deleting your local version of your repository. Then clone your remote repository and then add your local changes back.
-
4 hours ago, DoctorLOGiQ said:
Does some kind of synchronisation need to happen?
By default capabilities are not synced to the client. However I would assume that Choonster’s code would have something in it to sync the values. Choonster said that the 1.13.2 update if their test mod is very WIP, so it might not be on GitHub it even written yet.
-
Sorry we don't support 1.9.4 or any version under 1.10 on this forum anymore due to its age. We simply don't know how to help you anymore. You can go to the Minecraft Forum where I think that they still still support older versions, or update to a modern version of Minecraft (the latest version or the one before it) to receive support on this forum.
-
-
-
-
12 hours ago, Etomic said:
forge does not see it as a mod anymore
This is because OptiFine internally does not have the code for Forge to load it as a Forge mod. See https://github.com/sp614x/optifine/issues/2148
-
I’m pretty sure that’s a Mac application crash report (not a minecraft one)
5 hours ago, ProdigyOfGenres said:Terminating app due to uncaught exception 'JavaNativeException', reason: 'java.lang.NoClassDefFoundError: Could not initialize class sun.lwawt.macosx.LWCToolkit'
terminating with uncaught exception of type JNFExceptionSomethings going horribly wrong with Java. Did you change any of your launcher options? Does normal minecraft work fine?
-
1 minute ago, Thegametutor101 said:
I create a method in the Proxies named "addOBJLoaderDomainIfOnClient" that has inside of it the OBJLoader.addDomain.
No, you create an empty method if you’re using a normal class or an abstract method if your using an abstract class or define a method if your using an interface.
2 minutes ago, Thegametutor101 said:Then in my RegistryHandler (where I register all items/blocks @BusSubscribeEvent) I would call the method in my proxy through a @SubscribeEvent.
This would work but it doesn’t make sense to call it from there, you would call the method in preInit.
3 minutes ago, Thegametutor101 said:And finally I have the CommonProxy implement "NOOP"
If your using a class, yes. NOOP stands for NO OPeration i.e. do nothing.
4 minutes ago, Thegametutor101 said:I'm not sure if you mean't I call the "addOBJLoaderDomainIfOnClient" method from the Main's preInit
or in a "@BusSubscribeEvent" s "@SubscribeEvent".
If your using a proxy, you would call it from preInit. If you’re doing it in a client event subscriber you can just call it from inside a static initialiser, without any other code at all.
-
-
Edited by Cadiboo
I would just not use proxies at all. I would put OBJLoader.addDomain in the static initialisers of my client event subscriber.
Proxies work by having a common interface that both your server and client proxy implement and having a field with @SidedProxy that Forge will fill with an instance of either your server or client proxy class when your mod is loaded. This allows you to run code that will crash on the wrong physical side. For your problem you should have a method in your proxy interface called addOBJLoaderDomainIfOnClient. Then your server proxy should have a NOOP implementation (an implementation that doesn’t do anything at all) and your client proxy should have an implementation that calls OBJLoader.addDomain. You would then call PROXY.addOBJLoaderDomainIfOnClientin preInit. On the dedicated server this would do nothing, and on the client it will register your domain.
As you can see, proxies are a lot more complicated than sided event subscribers where everything just works(tm).

How to get player to join server
in Modder Support
Look at the code that gets executed when you join a server