Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About GrigLog

  • Rank
    Tree Puncher

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Ive made an armor model in Blockbench (just a bunch of random stripes), exported it as a .java object and binded a texture to it. The problem is, it is not rendered as it should, it just floats with the player. Model code (mostly generated by Blockbench): public class CustomArmorModel extends BipedModel<LivingEntity> { private final ModelRenderer Head; private final ModelRenderer Body; private final ModelRenderer RightArm; private final ModelRenderer LeftArm; private final ModelRenderer RightLeg; private final ModelRenderer LeftLeg; public CustomArmorModel() { super(1)
  2. Yes, this time you were right. But how can I sync server with client now? I dont see any Event of (de)serialization
  3. Btw I obtain all Capabilities references in code like this: SoulCap cap = player.getCapability(SoulCap.SoulProvider.SOUL_CAP, null).resolve().get(); mb this one is incorrect?
  4. They are called, and they change the SoulProvider.instance and save it to nbt as intended. But looks like the player has some other instance of SoulProvider, which is never (de)serialized. I literally see maxMana=20 in debug and maxMana=10 in game.
  5. Ive made it like this, but nothing changed: public static class SoulProvider implements ICapabilitySerializable<INBT> { @CapabilityInject(SoulCap.class) public static Capability<SoulCap> SOUL_CAP; private final LazyOptional<SoulCap> instance = LazyOptional.of(() -> new SoulCap()); @Override public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable Direction side) { return cap == SOUL_CAP ? instance.cast() : LazyOptional.empty(); } @Override public <T&
  6. It works fine in-game, but when I re-enter the world, all the fields are set to their default values. Its strange because Ive implemented writeNBT and readNBT methods. Also client and server are synchronized, so its not the problem. Capability code: public class SoulCap { public int parryTimer = 0; public int CATimer = 0; public boolean justParried = false; public boolean rightClicked = false; public boolean leftClicked = false; public double mana = 0; public double maxMana = 10; public HashMap<String, Integer> usedKeyItems = new HashMap<&g
  7. Looks like minecraft uses Blaze3D for rendering, but I have no idea what to do with these MatrixStacks, RenderTypeBuffers, etc, and I cant find any documentation about it. Vanilla examples are not helpful at all, because all the variables lost their original names and its impossible to understand whats going on. Any suggestions where to start?
  8. Oh hell, that was the problem, now it finally works XD Im just tired and didnt notice that, thanks a lot!
  9. I think Ive done everything as it and you say, and I looked through other mods code and it looks similar everywhere, but the arrows are still invisible, whats wrong? public class Entities { public static final EntityType<HolyArrow> holyArrow = EntityType.Builder .<HolyArrow>create(HolyArrow::new, EntityClassification.MISC) .size(1, 1) .build(""); } public class HolyArrow extends AbstractArrowEntity { public HolyArrow(World world, PlayerEntity player){ super(Entities.holyArrow, player, world); } public HolyArrow (Ent
  10. The problem is, in docs its only said how to register EntityTypes through DeferredRegisters... Ive added an override for getType() {return Entities.holyArrow;} now the arrows are simply invisible. Am I doing right? Ok, but it didnt change anything
  11. Ive already made an arrow entity (derived from vanilla one), and it works fine (they dont get picked up by a player), but for some reason my texture is not rendered, the arrow looks like vanilla one... Arrow code: public class HolyArrow extends ArrowEntity { public HolyArrow(World world, PlayerEntity player){ super(world, player); } public HolyArrow(EntityType<HolyArrow> type, World world){ super(type, world); } public void onCollideWithPlayer(PlayerEntity entityIn) {} //no pickup public static EntityType<HolyArrow> getRegistryTyp
  12. I was able to do the second thing. If someone is interested: 1) Subscribe to a right-click input event @SubscribeEvent public static void onEvent(InputEvent.MouseInputEvent event) { KeyBinding keyUse = Minecraft.getInstance().gameSettings.keyBindUseItem; if (event.getButton() == 1 && event.getAction() == 1) { //right button pressed down SoulCap soulCap = Minecraft.getInstance().player.getCapability(SoulProvider.SOUL_CAP, null).resolve().get(); soulCap.setRightClicked(true); //use a capability to save the info PacketSender
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.