优化procedure
This commit is contained in:
parent
784c1c108c
commit
9046aa4214
35 changed files with 92 additions and 124 deletions
|
@ -25,6 +25,7 @@ import java.util.function.Supplier;
|
||||||
@Mod("target")
|
@Mod("target")
|
||||||
public class TargetMod {
|
public class TargetMod {
|
||||||
public static final String MODID = "target";
|
public static final String MODID = "target";
|
||||||
|
public static final String ATTRIBUTE_MODIFIER = "target_attribute_modifier";
|
||||||
|
|
||||||
public TargetMod() {
|
public TargetMod() {
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
|
|
|
@ -2,7 +2,7 @@ package net.mcreator.target.client.layer;
|
||||||
|
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
import net.mcreator.target.item.gun.AK47;
|
import net.mcreator.target.item.gun.AK47Item;
|
||||||
import net.minecraft.client.renderer.MultiBufferSource;
|
import net.minecraft.client.renderer.MultiBufferSource;
|
||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.renderer.RenderType;
|
||||||
import net.minecraft.client.renderer.texture.OverlayTexture;
|
import net.minecraft.client.renderer.texture.OverlayTexture;
|
||||||
|
@ -11,15 +11,15 @@ import software.bernie.geckolib.cache.object.BakedGeoModel;
|
||||||
import software.bernie.geckolib.renderer.GeoRenderer;
|
import software.bernie.geckolib.renderer.GeoRenderer;
|
||||||
import software.bernie.geckolib.renderer.layer.GeoRenderLayer;
|
import software.bernie.geckolib.renderer.layer.GeoRenderLayer;
|
||||||
|
|
||||||
public class AK47Layer extends GeoRenderLayer<AK47> {
|
public class AK47Layer extends GeoRenderLayer<AK47Item> {
|
||||||
private static final ResourceLocation LAYER = new ResourceLocation("target", "textures/item/ak47_e.png");
|
private static final ResourceLocation LAYER = new ResourceLocation("target", "textures/item/ak47_e.png");
|
||||||
|
|
||||||
public AK47Layer(GeoRenderer<AK47> entityRenderer) {
|
public AK47Layer(GeoRenderer<AK47Item> entityRenderer) {
|
||||||
super(entityRenderer);
|
super(entityRenderer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(PoseStack poseStack, AK47 animatable, BakedGeoModel bakedModel, RenderType renderType, MultiBufferSource bufferSource, VertexConsumer buffer, float partialTick, int packedLight, int packedOverlay) {
|
public void render(PoseStack poseStack, AK47Item animatable, BakedGeoModel bakedModel, RenderType renderType, MultiBufferSource bufferSource, VertexConsumer buffer, float partialTick, int packedLight, int packedOverlay) {
|
||||||
RenderType glowRenderType = RenderType.eyes(LAYER);
|
RenderType glowRenderType = RenderType.eyes(LAYER);
|
||||||
getRenderer().reRender(getDefaultBakedModel(animatable), poseStack, bufferSource, animatable, glowRenderType, bufferSource.getBuffer(glowRenderType), partialTick, packedLight, OverlayTexture.NO_OVERLAY, 1, 1, 1, 1);
|
getRenderer().reRender(getDefaultBakedModel(animatable), poseStack, bufferSource, animatable, glowRenderType, bufferSource.getBuffer(glowRenderType), partialTick, packedLight, OverlayTexture.NO_OVERLAY, 1, 1, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ package net.mcreator.target.client.layer;
|
||||||
|
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
import net.mcreator.target.item.gun.Sks;
|
import net.mcreator.target.item.gun.SksItem;
|
||||||
import net.minecraft.client.renderer.MultiBufferSource;
|
import net.minecraft.client.renderer.MultiBufferSource;
|
||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.renderer.RenderType;
|
||||||
import net.minecraft.client.renderer.texture.OverlayTexture;
|
import net.minecraft.client.renderer.texture.OverlayTexture;
|
||||||
|
@ -11,15 +11,15 @@ import software.bernie.geckolib.cache.object.BakedGeoModel;
|
||||||
import software.bernie.geckolib.renderer.GeoRenderer;
|
import software.bernie.geckolib.renderer.GeoRenderer;
|
||||||
import software.bernie.geckolib.renderer.layer.GeoRenderLayer;
|
import software.bernie.geckolib.renderer.layer.GeoRenderLayer;
|
||||||
|
|
||||||
public class SksLayer extends GeoRenderLayer<Sks> {
|
public class SksLayer extends GeoRenderLayer<SksItem> {
|
||||||
private static final ResourceLocation LAYER = new ResourceLocation("target", "textures/item/sks_e.png");
|
private static final ResourceLocation LAYER = new ResourceLocation("target", "textures/item/sks_e.png");
|
||||||
|
|
||||||
public SksLayer(GeoRenderer<Sks> entityRenderer) {
|
public SksLayer(GeoRenderer<SksItem> entityRenderer) {
|
||||||
super(entityRenderer);
|
super(entityRenderer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(PoseStack poseStack, Sks animatable, BakedGeoModel bakedModel, RenderType renderType, MultiBufferSource bufferSource, VertexConsumer buffer, float partialTick, int packedLight, int packedOverlay) {
|
public void render(PoseStack poseStack, SksItem animatable, BakedGeoModel bakedModel, RenderType renderType, MultiBufferSource bufferSource, VertexConsumer buffer, float partialTick, int packedLight, int packedOverlay) {
|
||||||
RenderType glowRenderType = RenderType.eyes(LAYER);
|
RenderType glowRenderType = RenderType.eyes(LAYER);
|
||||||
getRenderer().reRender(getDefaultBakedModel(animatable), poseStack, bufferSource, animatable, glowRenderType, bufferSource.getBuffer(glowRenderType), partialTick, packedLight, OverlayTexture.NO_OVERLAY, 1, 1, 1, 1);
|
getRenderer().reRender(getDefaultBakedModel(animatable), poseStack, bufferSource, animatable, glowRenderType, bufferSource.getBuffer(glowRenderType), partialTick, packedLight, OverlayTexture.NO_OVERLAY, 1, 1, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package net.mcreator.target.client.model.item;
|
package net.mcreator.target.client.model.item;
|
||||||
|
|
||||||
import net.mcreator.target.item.gun.AK47;
|
import net.mcreator.target.item.gun.AK47Item;
|
||||||
import net.mcreator.target.network.TargetModVariables;
|
import net.mcreator.target.network.TargetModVariables;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
@ -10,24 +10,24 @@ import software.bernie.geckolib.core.animatable.model.CoreGeoBone;
|
||||||
import software.bernie.geckolib.core.animation.AnimationState;
|
import software.bernie.geckolib.core.animation.AnimationState;
|
||||||
import software.bernie.geckolib.model.GeoModel;
|
import software.bernie.geckolib.model.GeoModel;
|
||||||
|
|
||||||
public class AK47ItemModel extends GeoModel<AK47> {
|
public class AK47ItemModel extends GeoModel<AK47Item> {
|
||||||
@Override
|
@Override
|
||||||
public ResourceLocation getAnimationResource(AK47 animatable) {
|
public ResourceLocation getAnimationResource(AK47Item animatable) {
|
||||||
return new ResourceLocation("target", "animations/ak.animation.json");
|
return new ResourceLocation("target", "animations/ak.animation.json");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResourceLocation getModelResource(AK47 animatable) {
|
public ResourceLocation getModelResource(AK47Item animatable) {
|
||||||
return new ResourceLocation("target", "geo/ak.geo.json");
|
return new ResourceLocation("target", "geo/ak.geo.json");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResourceLocation getTextureResource(AK47 animatable) {
|
public ResourceLocation getTextureResource(AK47Item animatable) {
|
||||||
return new ResourceLocation("target", "textures/item/ak47.png");
|
return new ResourceLocation("target", "textures/item/ak47.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setCustomAnimations(AK47 animatable, long instanceId, AnimationState animationState) {
|
public void setCustomAnimations(AK47Item animatable, long instanceId, AnimationState animationState) {
|
||||||
CoreGeoBone gun = getAnimationProcessor().getBone("bone");
|
CoreGeoBone gun = getAnimationProcessor().getBone("bone");
|
||||||
CoreGeoBone shen = getAnimationProcessor().getBone("shen");
|
CoreGeoBone shen = getAnimationProcessor().getBone("shen");
|
||||||
CoreGeoBone scope = getAnimationProcessor().getBone("kobra");
|
CoreGeoBone scope = getAnimationProcessor().getBone("kobra");
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package net.mcreator.target.client.model.item;
|
package net.mcreator.target.client.model.item;
|
||||||
|
|
||||||
import net.mcreator.target.item.gun.Sks;
|
import net.mcreator.target.item.gun.SksItem;
|
||||||
import net.mcreator.target.network.TargetModVariables;
|
import net.mcreator.target.network.TargetModVariables;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
@ -10,25 +10,25 @@ import software.bernie.geckolib.core.animatable.model.CoreGeoBone;
|
||||||
import software.bernie.geckolib.core.animation.AnimationState;
|
import software.bernie.geckolib.core.animation.AnimationState;
|
||||||
import software.bernie.geckolib.model.GeoModel;
|
import software.bernie.geckolib.model.GeoModel;
|
||||||
|
|
||||||
public class SksItemModel extends GeoModel<Sks> {
|
public class SksItemModel extends GeoModel<SksItem> {
|
||||||
@Override
|
@Override
|
||||||
public ResourceLocation getAnimationResource(Sks animatable) {
|
public ResourceLocation getAnimationResource(SksItem animatable) {
|
||||||
return new ResourceLocation("target", "animations/sks.animation.json");
|
return new ResourceLocation("target", "animations/sks.animation.json");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResourceLocation getModelResource(Sks animatable) {
|
public ResourceLocation getModelResource(SksItem animatable) {
|
||||||
return new ResourceLocation("target", "geo/sks.geo.json");
|
return new ResourceLocation("target", "geo/sks.geo.json");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResourceLocation getTextureResource(Sks animatable) {
|
public ResourceLocation getTextureResource(SksItem animatable) {
|
||||||
return new ResourceLocation("target", "textures/item/sks.png");
|
return new ResourceLocation("target", "textures/item/sks.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setCustomAnimations(Sks animatable, long instanceId, AnimationState animationState) {
|
public void setCustomAnimations(SksItem animatable, long instanceId, AnimationState animationState) {
|
||||||
CoreGeoBone gun = getAnimationProcessor().getBone("bone");
|
CoreGeoBone gun = getAnimationProcessor().getBone("bone");
|
||||||
CoreGeoBone flare = getAnimationProcessor().getBone("flare");
|
CoreGeoBone flare = getAnimationProcessor().getBone("flare");
|
||||||
CoreGeoBone bolt = getAnimationProcessor().getBone("bolt");
|
CoreGeoBone bolt = getAnimationProcessor().getBone("bolt");
|
||||||
|
|
|
@ -2,7 +2,7 @@ package net.mcreator.target.client.renderer.item;
|
||||||
|
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
import net.mcreator.target.item.gun.AK47;
|
import net.mcreator.target.item.gun.AK47Item;
|
||||||
import net.mcreator.target.client.layer.AK47Layer;
|
import net.mcreator.target.client.layer.AK47Layer;
|
||||||
import net.mcreator.target.client.model.item.AK47ItemModel;
|
import net.mcreator.target.client.model.item.AK47ItemModel;
|
||||||
import net.minecraft.client.renderer.MultiBufferSource;
|
import net.minecraft.client.renderer.MultiBufferSource;
|
||||||
|
@ -16,14 +16,14 @@ import software.bernie.geckolib.renderer.GeoItemRenderer;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class AK47ItemRenderer extends GeoItemRenderer<AK47> {
|
public class AK47ItemRenderer extends GeoItemRenderer<AK47Item> {
|
||||||
public AK47ItemRenderer() {
|
public AK47ItemRenderer() {
|
||||||
super(new AK47ItemModel());
|
super(new AK47ItemModel());
|
||||||
this.addRenderLayer(new AK47Layer(this));
|
this.addRenderLayer(new AK47Layer(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RenderType getRenderType(AK47 animatable, ResourceLocation texture, MultiBufferSource bufferSource, float partialTick) {
|
public RenderType getRenderType(AK47Item animatable, ResourceLocation texture, MultiBufferSource bufferSource, float partialTick) {
|
||||||
return RenderType.entityTranslucent(getTextureLocation(animatable));
|
return RenderType.entityTranslucent(getTextureLocation(animatable));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ public class AK47ItemRenderer extends GeoItemRenderer<AK47> {
|
||||||
protected MultiBufferSource currentBuffer;
|
protected MultiBufferSource currentBuffer;
|
||||||
protected RenderType renderType;
|
protected RenderType renderType;
|
||||||
public ItemDisplayContext transformType;
|
public ItemDisplayContext transformType;
|
||||||
protected AK47 animatable;
|
protected AK47Item animatable;
|
||||||
private final Set<String> hiddenBones = new HashSet<>();
|
private final Set<String> hiddenBones = new HashSet<>();
|
||||||
private final Set<String> suppressedBones = new HashSet<>();
|
private final Set<String> suppressedBones = new HashSet<>();
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ public class AK47ItemRenderer extends GeoItemRenderer<AK47> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actuallyRender(PoseStack matrixStackIn, AK47 animatable, BakedGeoModel model, RenderType type, MultiBufferSource renderTypeBuffer, VertexConsumer vertexBuilder, boolean isRenderer, float partialTicks, int packedLightIn,
|
public void actuallyRender(PoseStack matrixStackIn, AK47Item animatable, BakedGeoModel model, RenderType type, MultiBufferSource renderTypeBuffer, VertexConsumer vertexBuilder, boolean isRenderer, float partialTicks, int packedLightIn,
|
||||||
int packedOverlayIn, float red, float green, float blue, float alpha) {
|
int packedOverlayIn, float red, float green, float blue, float alpha) {
|
||||||
this.currentBuffer = renderTypeBuffer;
|
this.currentBuffer = renderTypeBuffer;
|
||||||
this.renderType = type;
|
this.renderType = type;
|
||||||
|
@ -57,7 +57,7 @@ public class AK47ItemRenderer extends GeoItemRenderer<AK47> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResourceLocation getTextureLocation(AK47 instance) {
|
public ResourceLocation getTextureLocation(AK47Item instance) {
|
||||||
return super.getTextureLocation(instance);
|
return super.getTextureLocation(instance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ package net.mcreator.target.client.renderer.item;
|
||||||
|
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
import net.mcreator.target.item.gun.Sks;
|
import net.mcreator.target.item.gun.SksItem;
|
||||||
import net.mcreator.target.client.layer.SksLayer;
|
import net.mcreator.target.client.layer.SksLayer;
|
||||||
import net.mcreator.target.client.model.item.SksItemModel;
|
import net.mcreator.target.client.model.item.SksItemModel;
|
||||||
import net.minecraft.client.renderer.MultiBufferSource;
|
import net.minecraft.client.renderer.MultiBufferSource;
|
||||||
|
@ -16,14 +16,14 @@ import software.bernie.geckolib.renderer.GeoItemRenderer;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class SksItemRenderer extends GeoItemRenderer<Sks> {
|
public class SksItemRenderer extends GeoItemRenderer<SksItem> {
|
||||||
public SksItemRenderer() {
|
public SksItemRenderer() {
|
||||||
super(new SksItemModel());
|
super(new SksItemModel());
|
||||||
this.addRenderLayer(new SksLayer(this));
|
this.addRenderLayer(new SksLayer(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RenderType getRenderType(Sks animatable, ResourceLocation texture, MultiBufferSource bufferSource, float partialTick) {
|
public RenderType getRenderType(SksItem animatable, ResourceLocation texture, MultiBufferSource bufferSource, float partialTick) {
|
||||||
return RenderType.entityTranslucent(getTextureLocation(animatable));
|
return RenderType.entityTranslucent(getTextureLocation(animatable));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ public class SksItemRenderer extends GeoItemRenderer<Sks> {
|
||||||
protected MultiBufferSource currentBuffer;
|
protected MultiBufferSource currentBuffer;
|
||||||
protected RenderType renderType;
|
protected RenderType renderType;
|
||||||
public ItemDisplayContext transformType;
|
public ItemDisplayContext transformType;
|
||||||
protected Sks animatable;
|
protected SksItem animatable;
|
||||||
private final Set<String> hiddenBones = new HashSet<>();
|
private final Set<String> hiddenBones = new HashSet<>();
|
||||||
private final Set<String> suppressedBones = new HashSet<>();
|
private final Set<String> suppressedBones = new HashSet<>();
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ public class SksItemRenderer extends GeoItemRenderer<Sks> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actuallyRender(PoseStack matrixStackIn, Sks animatable, BakedGeoModel model, RenderType type, MultiBufferSource renderTypeBuffer, VertexConsumer vertexBuilder, boolean isRenderer, float partialTicks, int packedLightIn,
|
public void actuallyRender(PoseStack matrixStackIn, SksItem animatable, BakedGeoModel model, RenderType type, MultiBufferSource renderTypeBuffer, VertexConsumer vertexBuilder, boolean isRenderer, float partialTicks, int packedLightIn,
|
||||||
int packedOverlayIn, float red, float green, float blue, float alpha) {
|
int packedOverlayIn, float red, float green, float blue, float alpha) {
|
||||||
this.currentBuffer = renderTypeBuffer;
|
this.currentBuffer = renderTypeBuffer;
|
||||||
this.renderType = type;
|
this.renderType = type;
|
||||||
|
@ -57,7 +57,7 @@ public class SksItemRenderer extends GeoItemRenderer<Sks> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResourceLocation getTextureLocation(Sks instance) {
|
public ResourceLocation getTextureLocation(SksItem instance) {
|
||||||
return super.getTextureLocation(instance);
|
return super.getTextureLocation(instance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,12 +52,12 @@ public class ItemAnimationFactory {
|
||||||
animatable.animationprocedure = animation;
|
animatable.animationprocedure = animation;
|
||||||
disableUseAnim();
|
disableUseAnim();
|
||||||
}
|
}
|
||||||
if (event.player.getMainHandItem().getItem() instanceof AK47 animatable)
|
if (event.player.getMainHandItem().getItem() instanceof AK47Item animatable)
|
||||||
if (event.player.level().isClientSide()) {
|
if (event.player.level().isClientSide()) {
|
||||||
animatable.animationprocedure = animation;
|
animatable.animationprocedure = animation;
|
||||||
disableUseAnim();
|
disableUseAnim();
|
||||||
}
|
}
|
||||||
if (event.player.getMainHandItem().getItem() instanceof Sks animatable)
|
if (event.player.getMainHandItem().getItem() instanceof SksItem animatable)
|
||||||
if (event.player.level().isClientSide()) {
|
if (event.player.level().isClientSide()) {
|
||||||
animatable.animationprocedure = animation;
|
animatable.animationprocedure = animation;
|
||||||
disableUseAnim();
|
disableUseAnim();
|
||||||
|
@ -186,12 +186,12 @@ public class ItemAnimationFactory {
|
||||||
animatable.animationprocedure = animation;
|
animatable.animationprocedure = animation;
|
||||||
disableUseAnim();
|
disableUseAnim();
|
||||||
}
|
}
|
||||||
if (event.player.getOffhandItem().getItem() instanceof AK47 animatable)
|
if (event.player.getOffhandItem().getItem() instanceof AK47Item animatable)
|
||||||
if (event.player.level().isClientSide()) {
|
if (event.player.level().isClientSide()) {
|
||||||
animatable.animationprocedure = animation;
|
animatable.animationprocedure = animation;
|
||||||
disableUseAnim();
|
disableUseAnim();
|
||||||
}
|
}
|
||||||
if (event.player.getOffhandItem().getItem() instanceof Sks animatable)
|
if (event.player.getOffhandItem().getItem() instanceof SksItem animatable)
|
||||||
if (event.player.level().isClientSide()) {
|
if (event.player.level().isClientSide()) {
|
||||||
animatable.animationprocedure = animation;
|
animatable.animationprocedure = animation;
|
||||||
disableUseAnim();
|
disableUseAnim();
|
||||||
|
|
|
@ -30,8 +30,8 @@ public class TargetModItems {
|
||||||
public static final RegistryObject<Item> ABEKIRI = GUNS.register("abekiri", Abekiri::new);
|
public static final RegistryObject<Item> ABEKIRI = GUNS.register("abekiri", Abekiri::new);
|
||||||
public static final RegistryObject<Item> TRACHELIUM = GUNS.register("trachelium", Trachelium::new);
|
public static final RegistryObject<Item> TRACHELIUM = GUNS.register("trachelium", Trachelium::new);
|
||||||
public static final RegistryObject<Item> VECTOR = GUNS.register("vector", Vector::new);
|
public static final RegistryObject<Item> VECTOR = GUNS.register("vector", Vector::new);
|
||||||
public static final RegistryObject<Item> AK_47 = GUNS.register("ak_47", AK47::new);
|
public static final RegistryObject<Item> AK_47 = GUNS.register("ak_47", AK47Item::new);
|
||||||
public static final RegistryObject<Item> SKS = GUNS.register("sks", Sks::new);
|
public static final RegistryObject<Item> SKS = GUNS.register("sks", SksItem::new);
|
||||||
public static final RegistryObject<Item> M_4 = GUNS.register("m_4", M4Item::new);
|
public static final RegistryObject<Item> M_4 = GUNS.register("m_4", M4Item::new);
|
||||||
public static final RegistryObject<Item> HK_416 = GUNS.register("hk_416", Hk416Item::new);
|
public static final RegistryObject<Item> HK_416 = GUNS.register("hk_416", Hk416Item::new);
|
||||||
public static final RegistryObject<Item> MK_14 = GUNS.register("mk_14", Mk14Item::new);
|
public static final RegistryObject<Item> MK_14 = GUNS.register("mk_14", Mk14Item::new);
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
package net.mcreator.target.item;
|
package net.mcreator.target.item;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMultimap;
|
import com.google.common.collect.HashMultimap;
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
|
import net.mcreator.target.TargetMod;
|
||||||
import net.mcreator.target.client.renderer.item.LightSaberItemRenderer;
|
import net.mcreator.target.client.renderer.item.LightSaberItemRenderer;
|
||||||
import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer;
|
import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
|
@ -27,13 +28,13 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class LightSaberItem extends Item implements GeoItem {
|
public class LightSaberItem extends SwordItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
|
||||||
public LightSaberItem() {
|
public LightSaberItem() {
|
||||||
super(new Item.Properties().stacksTo(1).rarity(Rarity.EPIC));
|
super(Tiers.NETHERITE, 10, -1.8f, new Item.Properties().rarity(Rarity.EPIC));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -93,20 +94,16 @@ public class LightSaberItem extends Item implements GeoItem {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(EquipmentSlot equipmentSlot) {
|
public Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(EquipmentSlot equipmentSlot) {
|
||||||
|
Multimap<Attribute, AttributeModifier> map = super.getDefaultAttributeModifiers(equipmentSlot);
|
||||||
UUID uuid = new UUID(equipmentSlot.toString().hashCode(), 0);
|
UUID uuid = new UUID(equipmentSlot.toString().hashCode(), 0);
|
||||||
if (equipmentSlot == EquipmentSlot.MAINHAND) {
|
if (equipmentSlot == EquipmentSlot.MAINHAND) {
|
||||||
ImmutableMultimap.Builder<Attribute, AttributeModifier> builder = ImmutableMultimap.builder();
|
map = HashMultimap.create(map);
|
||||||
builder.putAll(super.getDefaultAttributeModifiers(equipmentSlot));
|
map.put(Attributes.MOVEMENT_SPEED, new AttributeModifier(uuid, TargetMod.ATTRIBUTE_MODIFIER, 0.2f, AttributeModifier.Operation.MULTIPLY_BASE));
|
||||||
builder.put(Attributes.ATTACK_DAMAGE, new AttributeModifier(BASE_ATTACK_DAMAGE_UUID, "Item modifier", 14d, AttributeModifier.Operation.ADDITION));
|
|
||||||
builder.put(Attributes.ATTACK_SPEED, new AttributeModifier(BASE_ATTACK_SPEED_UUID, "Item modifier", -1.8, AttributeModifier.Operation.ADDITION));
|
|
||||||
builder.put(Attributes.MOVEMENT_SPEED, new AttributeModifier(uuid, "henghengaaa", 0.2f, AttributeModifier.Operation.MULTIPLY_BASE));
|
|
||||||
|
|
||||||
return builder.build();
|
|
||||||
}
|
}
|
||||||
return super.getDefaultAttributeModifiers(equipmentSlot);
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getEnchantmentValue() {
|
public int getEnchantmentValue() {
|
||||||
return 22;
|
return 22;
|
||||||
|
|
|
@ -32,12 +32,12 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class AK47 extends Item implements GeoItem {
|
public class AK47Item extends GunItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
|
||||||
public AK47() {
|
public AK47Item() {
|
||||||
super(new Item.Properties().stacksTo(1).rarity(Rarity.RARE));
|
super(new Item.Properties().stacksTo(1).rarity(Rarity.RARE));
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class Aa12Item extends Item implements GeoItem {
|
public class Aa12Item extends GunItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
|
|
@ -32,7 +32,7 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class Abekiri extends Item implements GeoItem {
|
public class Abekiri extends GunItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
|
|
@ -34,7 +34,7 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class BocekItem extends Item implements GeoItem {
|
public class BocekItem extends GunItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
|
|
@ -32,7 +32,7 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class Devotion extends Item implements GeoItem {
|
public class Devotion extends GunItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
|
18
src/main/java/net/mcreator/target/item/gun/GunItem.java
Normal file
18
src/main/java/net/mcreator/target/item/gun/GunItem.java
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
package net.mcreator.target.item.gun;
|
||||||
|
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import net.minecraft.world.item.Item;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
|
||||||
|
public class GunItem extends Item {
|
||||||
|
public GunItem(Properties properties) {
|
||||||
|
super(properties);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canAttackBlock(BlockState p_41441_, Level p_41442_, BlockPos p_41443_, Player p_41444_) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
|
@ -32,7 +32,7 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class Hk416Item extends Item implements GeoItem {
|
public class Hk416Item extends GunItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
|
|
@ -32,7 +32,7 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class HuntingRifle extends Item implements GeoItem {
|
public class HuntingRifle extends GunItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
|
|
@ -36,7 +36,7 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class Kraber extends Item implements GeoItem {
|
public class Kraber extends GunItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
|
|
@ -32,7 +32,7 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class M4Item extends Item implements GeoItem {
|
public class M4Item extends GunItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
|
|
@ -32,7 +32,7 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class M60Item extends Item implements GeoItem {
|
public class M60Item extends GunItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
|
|
@ -34,7 +34,7 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class M79Item extends Item implements GeoItem {
|
public class M79Item extends GunItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
|
|
@ -32,7 +32,7 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class M870Item extends Item implements GeoItem {
|
public class M870Item extends GunItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
|
|
@ -32,7 +32,7 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class M98bItem extends Item implements GeoItem {
|
public class M98bItem extends GunItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
|
|
@ -32,7 +32,7 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class MarlinItem extends Item implements GeoItem {
|
public class MarlinItem extends GunItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
|
|
@ -38,7 +38,7 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class Minigun extends Item implements GeoItem {
|
public class Minigun extends GunItem implements GeoItem {
|
||||||
private static final String TAG_HEAT = "heatbar";
|
private static final String TAG_HEAT = "heatbar";
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
|
|
|
@ -32,7 +32,7 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class Mk14Item extends Item implements GeoItem {
|
public class Mk14Item extends GunItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
|
|
@ -44,7 +44,7 @@ import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class RpgItem extends Item implements GeoItem {
|
public class RpgItem extends GunItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
|
|
@ -42,7 +42,7 @@ import net.mcreator.target.client.renderer.item.RpkItemRenderer;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class RpkItem extends Item implements GeoItem {
|
public class RpkItem extends GunItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
|
|
@ -32,12 +32,12 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class Sks extends Item implements GeoItem {
|
public class SksItem extends GunItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
|
||||||
public Sks() {
|
public SksItem() {
|
||||||
super(new Item.Properties().stacksTo(1).rarity(Rarity.RARE));
|
super(new Item.Properties().stacksTo(1).rarity(Rarity.RARE));
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class SvdItem extends Item implements GeoItem {
|
public class SvdItem extends GunItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
|
|
@ -34,7 +34,7 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class Taser extends Item implements GeoItem {
|
public class Taser extends GunItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
|
|
@ -2,6 +2,7 @@ package net.mcreator.target.item.gun;
|
||||||
|
|
||||||
import com.google.common.collect.HashMultimap;
|
import com.google.common.collect.HashMultimap;
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
|
import net.mcreator.target.TargetMod;
|
||||||
import net.mcreator.target.client.renderer.item.TracheliumItemRenderer;
|
import net.mcreator.target.client.renderer.item.TracheliumItemRenderer;
|
||||||
import net.mcreator.target.procedures.ReloadingProcedure;
|
import net.mcreator.target.procedures.ReloadingProcedure;
|
||||||
import net.mcreator.target.tools.RarityTool;
|
import net.mcreator.target.tools.RarityTool;
|
||||||
|
@ -33,7 +34,7 @@ import software.bernie.geckolib.util.GeckoLibUtil;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class Trachelium extends Item implements GeoItem {
|
public class Trachelium extends GunItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
@ -128,7 +129,7 @@ public class Trachelium extends Item implements GeoItem {
|
||||||
if (slot == EquipmentSlot.MAINHAND) {
|
if (slot == EquipmentSlot.MAINHAND) {
|
||||||
map = HashMultimap.create(map);
|
map = HashMultimap.create(map);
|
||||||
map.put(Attributes.MOVEMENT_SPEED,
|
map.put(Attributes.MOVEMENT_SPEED,
|
||||||
new AttributeModifier(uuid, "henghengaaa", -0.02f, AttributeModifier.Operation.MULTIPLY_BASE));
|
new AttributeModifier(uuid, TargetMod.ATTRIBUTE_MODIFIER, -0.02f, AttributeModifier.Operation.MULTIPLY_BASE));
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class Vector extends Item implements GeoItem {
|
public class Vector extends GunItem implements GeoItem {
|
||||||
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
public String animationprocedure = "empty";
|
public String animationprocedure = "empty";
|
||||||
public static ItemDisplayContext transformType;
|
public static ItemDisplayContext transformType;
|
||||||
|
|
|
@ -1,49 +0,0 @@
|
||||||
package net.mcreator.target.procedures;
|
|
||||||
|
|
||||||
import net.mcreator.target.init.TargetModItems;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.resources.ResourceLocation;
|
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
|
||||||
import net.minecraft.tags.ItemTags;
|
|
||||||
import net.minecraft.world.entity.Entity;
|
|
||||||
import net.minecraft.world.entity.LivingEntity;
|
|
||||||
import net.minecraft.world.entity.player.Player;
|
|
||||||
import net.minecraft.world.item.ItemStack;
|
|
||||||
import net.minecraft.world.level.GameType;
|
|
||||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
|
||||||
import net.minecraftforge.eventbus.api.Event;
|
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|
||||||
import net.minecraftforge.fml.common.Mod;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@Mod.EventBusSubscriber
|
|
||||||
public class QuxiaowafangkuaiProcedure {
|
|
||||||
@SubscribeEvent
|
|
||||||
public static void onLeftClickBlock(PlayerInteractEvent.LeftClickBlock event) {
|
|
||||||
if (event.getHand() != event.getEntity().getUsedItemHand())
|
|
||||||
return;
|
|
||||||
execute(event, event.getEntity());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void execute(Entity entity) {
|
|
||||||
execute(null, entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void execute(@Nullable Event event, Entity entity) {
|
|
||||||
if (entity == null)
|
|
||||||
return;
|
|
||||||
if (entity instanceof Player player && !player.isCreative()) {
|
|
||||||
if (player.getMainHandItem().getItem() == TargetModItems.LIGHT_SABER.get()) {
|
|
||||||
if (event != null && event.isCancelable()) {
|
|
||||||
event.setCanceled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY).is(ItemTags.create(new ResourceLocation("target:gun")))) {
|
|
||||||
if (event != null && event.isCancelable()) {
|
|
||||||
event.setCanceled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue