Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/04/19 in all areas

  1. Thanks in advance for pointing me in the right direction here! What is happening? I'm updating my mod from 1.10.2 to 1.13.2 and everything is working as expected except for the events. Some are working perfectly and others are never fired. I have commented the resulting behaviour in the below code. I've likely missed something pretty obvious and would really appreciate any help. How are you checking if the event is firing? I'm running the debug configuration for both client only and server + client, placing breakpoints and stepping through the code. What version of Forge are you working with? forge-1.13.2-25.0.107-mdk The code I am using to reproduce the issue: First, in the main mod class, I register the EventsCommon class instance and call the proxy to register the others. In the main mod class: EventsCommon: Then in the ClientProxy and ServerProxy hookEvents method, I register the EventsClient and EventsServer respectively. CommonProxy: ClientProxy: ServerProxy: Finally, the EventsClient and EventsServer classes. The EventsCommon class is posted above: EventsClient: EventsServer:
    1 point
  2. Take a quick look at this when you get a chance; it seems to provide a way to get the raw NBT in sponge. Just don't quote me on it, since I don't have any sponge experience: https://forums.spongepowered.org/t/how-to-get-and-change-nbt-of-an-item-simple-pls/14269/6
    1 point
  3. This is a lovely, comprehensive and well laid out post, regardless of code style. Personally I think you should just use the static event subscribing system as you can specify sides and not worry about registering the subscribers conditionally yourself (you can specify a Side in the annotation).
    1 point
  4. if you are looking for simple rotation, then stairs may not be the best example. Stairs rotate, but also can be placed upside down and their bounding boxes change. 1) add property facing to your block public static final PropertyDirection FACING = BlockHorizontal.FACING; 2) set default blockstate in the block constructor this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); 3) create the proper blockstatecontainer @Override protected BlockStateContainer createBlockState() { return new BlockStateContainer(this, new IProperty[] { FACING}); } 4) meta-> blockstate and blockstate->meta. a meta value is store with each blockstate. you have to convert this to and from the blockstate property value (below is taken from one of my blocks with other properties removed manually without testing, but think it is ok) @Override public IBlockState getStateFromMeta(int meta) { EnumFacing enumfacing = EnumFacing.getFront(meta); if (enumfacing.getAxis() == EnumFacing.Axis.Y) { enumfacing = EnumFacing.NORTH; } return this.getDefaultState().withProperty(FACING, enumfacing); } @Override public int getMetaFromState(IBlockState state) { EnumFacing facing=state.getValue(FACING); int meta=((EnumFacing)state.getValue(FACING)).getIndex(); return meta; } 5)set the property values in the blockstate json. (the "mod" is your modid, the "model" is your model json which should be located in assets/[mod]/models/block. If you wanted different models for different directions, just change here. { "variants": { "facing=north": { "model": "mod:model" }, "facing=east": { "model": "mod:model", "y": 90 }, "facing=south": { "model": "mod:model", "y": 180 }, "facing=west": { "model": "mod:model", "y": 270 }, } } I think that is all you need. Good luck. Don't get discouraged modding, once you get used to looking into the minecraft code, it gets easier.
    1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.