Everything posted by poopoodice
-
[1.16.1]Cannot set property direction property
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.
-
[1.16.1] Directional Block Deprecated Methods
It's ok to override these methods, it just tell you better not to use(call) them
-
How to make trident deal damage to entity hit on return path ?
there's a boolean in TridentEntity decides whether it should do entity raytracing
-
1.15.2 to 1.16.1
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
-
How do I add an ItemStack to a horse inventory slot?
try replaceItemInInventory()
-
How Do I make a .jar file
Using deprecated methods or variables or whatever shouldn't cause build failed. Also it did tell you where went wrong:
-
How Do I make a .jar file
what do you mean by "can't get it to work"? any error messages?
-
Class 'net.minecraftforge.userdev.LaunchTesting' not found in module
-
[1.16.1]How to scare mobs
you may find forge doc helpful
-
Prevent FULL AUTO item use
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
-
How to create Item with multiple Models?
ItemPropertyOverrides is the most simple way I can think of (check how BowItem does it)
-
Getting a serverside set value for the client
if you are only syncing some ints you can use the methods in Container class, I believe they are called trackedInt/trackIntArray
-
Setting output path for generated custom recipes
Not sure but you did not pass your mod id into the resource location?
-
1.15.2 Custom Block Model Particles Have no Texture
"textures": { "particle": "modid:item/texture.png" },
-
[1.15.2] Command tree examples
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
-
Items/Armor with Attributes
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
-
getQuads in IBakedModel not being called
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();
-
getQuads in IBakedModel not being called
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...
-
getQuads in IBakedModel not being called
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?
-
Creating a new type of ItemCameraTransforms/TransformType
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
-
Why is the new version of Forge so different from the old version of Forge?
it's the same public boolean onLeftClickEntity(ItemStack stack, PlayerEntity player, Entity entity)
-
About The WorldGenTrees Class Was Outdated
It looks like it's now different "tree features" you can find them in net.minecraft.world.gen.feature Feature.java
-
onEntityWalk not working
/gamerule fallDamage
-
[1.15] Changes to player and to tile entity from screen gui not saving.
there's some examples in it
-
Writing to compoundNBT, or checking when client connects?
You may need to write it yourself (such as storing them in intarrays...etc) and PlayerLoggedInEvent
IPS spam blocked by CleanTalk.