Jump to content

poopoodice

Members
  • Posts

    1160
  • Joined

  • Days Won

    7

Everything posted by poopoodice

  1. What problems are you facing, crash or whatever the error is? Anyways, my guess is the game crashed because you did not add the property to the state container.
  2. It's ok to override these methods, it just tell you better not to use(call) them
  3. there's a boolean in TridentEntity decides whether it should do entity raytracing
  4. https://wiki.mcjty.eu/modding/index.php?title=Tut14_Ep7 it's about 1.14 but I guess that applies on 1.16 as well
  5. Using deprecated methods or variables or whatever shouldn't cause build failed. Also it did tell you where went wrong:
  6. what do you mean by "can't get it to work"? any error messages?
  7. you may find forge doc helpful
  8. Input event only gets called once when pressed, which if you use TickEvent you can check if the mouse is down manually, and allows you to “fire while having the mouse pressed” instead of constantly clicking the mouse to fire
  9. ItemPropertyOverrides is the most simple way I can think of (check how BowItem does it)
  10. if you are only syncing some ints you can use the methods in Container class, I believe they are called trackedInt/trackIntArray
  11. Not sure but you did not pass your mod id into the resource location?
  12. "textures": { "particle": "modid:item/texture.png" },
  13. If my understanding is correct, .executes() needs to put inside the bracket of the .then (all "connected" action needs to do that)which should look like this root.then(Commands.literal("edit_a_float") .then(Commands.argument("float", FloatArgumentType.floatArg()) -> removed two brackets here .executes(source -> { return editPower(source.getSource(), source.getSource().asPlayer(), FloatArgumentType.getFloat(source, "float")); }))); -> added two brackets here
  14. override getAttributeModifiers(EquipmentSlotType slot, ItemStack stack) and then you can add new attributes to the multimap get from calling super.getAttributeModifiers(slot, stack) here's an example Multimap<String, AttributeModifier> multimap = super.getAttributeModifiers(slot, stack); if (slot == EquipmentSlotType.MAINHAND) multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", Integer.MAX_VALUE, AttributeModifier.Operation.ADDITION)); you can check vanilla sword for examples
  15. Hi, I think you are right : ) it came out with if you return this.origin.handlePerspective(type, mat) somehow getQuads() will no longer gets called On the other hand calls super works, or just do what I'm doing now: //some modification of rotationing scaling and translationing if (!transformationMatrix.isIdentity()) transformationMatrix.push(mat); return getBakedModel();
  16. So it came out with when I remove handlePerspective(ItemCameraTransforms.TransformType type, MatrixStack mat) it worked, gonna have a deeper look about why this happens...
  17. I feel it is more like a java related problem... anyways, here's my code: public abstract class GunModel implements IBakedModel { protected IBakedModel origin; public GunModel(IBakedModel origin) { this.origin = origin; } public abstract static class Overrides extends ItemOverrideList { public Overrides() { super(); } @Nullable @Override public IBakedModel getModelWithOverrides(IBakedModel origin, ItemStack stack, @Nullable World world, @Nullable LivingEntity entity) { if (!(stack.getItem() instanceof AVAItemGun)) return origin; CompoundNBT compound = ((AVAItemGun) stack.getItem()).initTags(stack); return getModel(origin, compound.getInt("fire"), compound.getInt("reload"), compound.getInt("run")); } protected abstract IBakedModel getModel(IBakedModel origin, int fire, int reload, int run); } } public class P226Model extends GunModel { protected P226Overrides overrides; public P226Model(IBakedModel origin) { super(origin); overrides = new P226Overrides(); } @Override public ItemOverrideList getOverrides() { return overrides; } public static class P226Overrides extends Overrides { public P226Overrides() { super(); } @Override protected IBakedModel getModel(IBakedModel origin, int fire, int reload, int run) { return new ModifiedP226Model(origin, fire, reload, run); } } } public class ModifiedGunModel implements IBakedModel { protected int fire; protected int reload; protected int run; protected IBakedModel origin; public ModifiedGunModel(IBakedModel origin, int fire, int reload, int run) { this.origin = origin; this.fire = fire; this.reload = reload; this.run = run; } @Override public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction side, Random rand) { System.out.println("parent"); return origin.getQuads(state, side, rand); } @Override public ItemOverrideList getOverrides() { return null; } } public class ModifiedP226Model extends ModifiedGunModel { public ModifiedP226Model(IBakedModel origin, int fire, int reload, int run) { super(origin, fire, reload, run); } @Override public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction side, Random rand) { System.out.println("inherited"); return origin.getQuads(state, side, rand); } @Override public IBakedModel handlePerspective(ItemCameraTransforms.TransformType type, MatrixStack mat) { Vector3f rotation = null; Vector3f translation = null; Vector3f scale = null; switch (type) { case THIRD_PERSON_LEFT_HAND: case THIRD_PERSON_RIGHT_HAND: rotation = new Vector3f(70, 0, 0); translation = new Vector3f(0, 1, 3); scale = vector3f(1.65F); break; case FIRST_PERSON_LEFT_HAND: case FIRST_PERSON_RIGHT_HAND: rotation = new Vector3f(0, -23, 0); translation = new Vector3f(-2, 3.5F, 1.5F); scale = new Vector3f(1.5F, 1.5F, 1.5F); if (type == ItemCameraTransforms.TransformType.FIRST_PERSON_RIGHT_HAND) this.modify(rotation, translation, scale, ItemCameraTransforms.TransformType.FIRST_PERSON_RIGHT_HAND); break; case GROUND: rotation = new Vector3f(0, 0, -90); break; case GUI: rotation = new Vector3f(0, -90, 0); translation = new Vector3f(-1, 1, 0); scale = vector3f(1.25F); break; case FIXED: rotation = new Vector3f(0, -90, 0); translation = new Vector3f(-1, 1.25F, 0); scale = vector3f(2); break; } this.getTransformationMatrix(rotation, translation, scale).push(mat); return this.origin.handlePerspective(type, mat); } } So what I'm struggling with is in @Override protected IBakedModel getModel(IBakedModel origin, int fire, int reload, int run) { return new ModifiedP226Model(origin, fire, reload, run); } if I return a "ModifiedGunModel", it's getQuads() gets called. However if I return "ModifiedP226Model" which inherits from the "ModifiedGunModel", neither getQuads() gets called. Did I missed something or is this just not how it works?
  18. Hello, I've followed TGG's guideline here (basically about IBakedModel), and I'm really confused. ItemCameraTransforms is deprecated and the doc indicates to TransformationMatrix and use it through handlePerspective(ItemCameraTransforms.TransformType cameraTransformType, MatrixStack mat) If all I want to do is simply translate and rotate the existing model: Do I still need to override getItemCameraTransforms() in my model, or handlePerspective(TransformType cameraTransformType, MatrixStack mat) is enough? w
  19. it's the same public boolean onLeftClickEntity(ItemStack stack, PlayerEntity player, Entity entity)
  20. It looks like it's now different "tree features" you can find them in net.minecraft.world.gen.feature Feature.java
  21. /gamerule fallDamage
  22. You may need to write it yourself (such as storing them in intarrays...etc) and PlayerLoggedInEvent
×
×
  • Create New...

Important Information

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