Skip to content

Commit

Permalink
移除偏移量,创建开发者标签页,注册调试枪
Browse files Browse the repository at this point in the history
  • Loading branch information
MustardOasis committed Oct 7, 2024
1 parent fdbeed8 commit 557bda0
Show file tree
Hide file tree
Showing 28 changed files with 393 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ protected void addTranslations() {
add("creativetab.confluence.armors", "汇流来世 | 盔甲");
add("creativetab.confluence.accessories", "汇流来世 | 配饰");
add("creativetab.confluence.mechanical", "汇流来世 | 器械");
add("creativetab.confluence.developer", "汇流来世 | 开发者物品");

add("item.confluence.meteorite_ingot.tooltip", "摸起来是温的");

Expand Down Expand Up @@ -1510,6 +1511,7 @@ protected void addTranslations() {
add(GunItems.UZI.get(), "乌兹冲锋枪");
add(GunItems.SHOTGUN.get(), "霰弹枪");
add(GunItems.MUSKET.get(), "火枪");
add(GunItems.DEBUGGUN.get(), "调试枪");
add(Bows.WOODEN_SHORT_BOW.get(), "木短弓");
add(Bows.COPPER_SHORT_BOW.get(), "铜短弓");
add(Bows.TIN_SHORT_BOW.get(), "锡短弓");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ protected void addTranslations() {
add("creativetab.confluence.armors", "Confluence | Armors");
add("creativetab.confluence.accessories", "Confluence | Accessories");
add("creativetab.confluence.mechanical", "Confluence | Mechanical");
add("creativetab.confluence.developer", "Confluence | Developer");

add("item.confluence.meteorite_ingot.tooltip", "Warm to the touch");
add("item.confluence.alpha.desc", "C418 - alpha");
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/org/confluence/mod/item/ModTabs.java
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,15 @@ public final class ModTabs {
for (Staffs staff : Staffs.values()) output.accept(staff.get());
})
.build());
// 开发者物品
public static final RegistryObject<CreativeModeTab> DEVELOPER = TABS.register("developer",
() -> CreativeModeTab.builder().icon(() -> new ItemStack(IconItem.Icons.DEVELOPER_ICON.get()))
.title(Component.translatable("creativetab.confluence.developer"))
.displayItems((parameters, output) -> {
output.accept(Swords.CROWBAR.get());
output.accept(GunItems.DEBUGGUN.get());
})
.build());
// 食物与药水
public static final RegistryObject<CreativeModeTab> FOOD_AND_POTIONS = TABS.register("food_and_potions",
() -> CreativeModeTab.builder().icon(() -> new ItemStack(IconItem.Icons.POTION_ICON.get()))
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/confluence/mod/item/common/IconItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public enum Icons implements EnumRegister<IconItem> {
POTION_ICON("potion_icon"),
PRECIOUS_ICON("precious_icon"),
SUMMON_ICON("summon_icon"),
DEVELOPER_ICON("developer_icon"),
ACCESSORIES_ICON("accessories_icon"),
TOOLS_ICON("tools_icon"),
MECHANICAL_ICON("mechanical_icon");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/confluence/mod/item/gun/BlowgunItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player,
int r = arm == HumanoidArm.RIGHT ? 1 : -1;
poseStack.translate(r * 0.56F, -0.52F + equipProcess * -0.6F, -0.72F);

poseStack.translate(r * 0F, -0.15F, -0.1);
poseStack.translate(r * 0F, 0, 0);
poseStack.mulPose(Axis.XP.rotationDegrees(0F));
poseStack.mulPose(Axis.YP.rotationDegrees(r * 0F));
poseStack.mulPose(Axis.ZP.rotationDegrees(r * 0F));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player,
int r = arm == HumanoidArm.RIGHT ? 1 : -1;
poseStack.translate(r * 0.56F, -0.52F + equipProcess * -0.6F, -0.72F);

poseStack.translate(r * 0F, -0.15F, -0.1);
poseStack.translate(r * 0F, 0, 0);
poseStack.mulPose(Axis.XP.rotationDegrees(0F));
poseStack.mulPose(Axis.YP.rotationDegrees(r * 0F));
poseStack.mulPose(Axis.ZP.rotationDegrees(r * 0F));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player,
int r = arm == HumanoidArm.RIGHT ? 1 : -1;
poseStack.translate(r * 0.56F, -0.52F + equipProcess * -0.6F, -0.72F);

poseStack.translate(r * 0F, -0.15F, -0.1);
poseStack.translate(r * 0F, 0, 0);
poseStack.mulPose(Axis.XP.rotationDegrees(0F));
poseStack.mulPose(Axis.YP.rotationDegrees(r * 0F));
poseStack.mulPose(Axis.ZP.rotationDegrees(r * 0F));
Expand Down
61 changes: 61 additions & 0 deletions src/main/java/org/confluence/mod/item/gun/DebugGunItem.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package org.confluence.mod.item.gun;

import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Axis;
import net.minecraft.client.model.HumanoidModel;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.HumanoidArm;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.client.extensions.common.IClientItemExtensions;
import org.confluence.mod.client.renderer.item.gun.DefaultGunItemRenderer;
import org.confluence.mod.misc.ModArmPoses;
import org.confluence.mod.misc.ModRarity;
import org.jetbrains.annotations.NotNull;
import software.bernie.geckolib.core.animation.AnimatableManager;

import java.util.function.Consumer;

public class DebugGunItem extends AbstractGunItem {
public DebugGunItem() {
super(ModRarity.RED);
}

@Override
public void initializeClient(@NotNull Consumer<IClientItemExtensions> consumer) {
consumer.accept(new IClientItemExtensions() {
private DefaultGunItemRenderer<DebugGunItem> renderer;

@Override
public BlockEntityWithoutLevelRenderer getCustomRenderer() {
if (renderer == null) {
this.renderer = new DefaultGunItemRenderer<>("debuggun");
}
return renderer;
}

@Override
public HumanoidModel.ArmPose getArmPose(LivingEntity entityLiving, InteractionHand hand, ItemStack itemStack) {
return ModArmPoses.HANDGUN;
}

@Override
public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player, HumanoidArm arm, ItemStack itemInHand, float partialTick, float equipProcess, float swingProcess) {
int r = arm == HumanoidArm.RIGHT ? 1 : -1;
poseStack.translate(r * 0.56F, -0.52F + equipProcess * -0.6F, -0.72F);

poseStack.translate(r * 0F, 0, 0);
poseStack.mulPose(Axis.XP.rotationDegrees(0F));
poseStack.mulPose(Axis.YP.rotationDegrees(r * 0F));
poseStack.mulPose(Axis.ZP.rotationDegrees(r * 0F));
poseStack.mulPose(Axis.YN.rotationDegrees(r * 0F));
return true;
}
});
}

@Override
public void registerControllers(AnimatableManager.ControllerRegistrar controllers) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player,
int r = arm == HumanoidArm.RIGHT ? 1 : -1;
poseStack.translate(r * 0.56F, -0.52F + equipProcess * -0.6F, -0.72F);

poseStack.translate(r * 0F, -0.15F, -0.1);
poseStack.translate(r * 0F, 0, 0);
poseStack.mulPose(Axis.XP.rotationDegrees(0F));
poseStack.mulPose(Axis.YP.rotationDegrees(r * 0F));
poseStack.mulPose(Axis.ZP.rotationDegrees(r * 0F));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player,
int r = arm == HumanoidArm.RIGHT ? 1 : -1;
poseStack.translate(r * 0.56F, -0.52F + equipProcess * -0.6F, -0.72F);

poseStack.translate(r * 0F, -0.15F, -0.1);
poseStack.translate(r * 0F, 0, 0);
poseStack.mulPose(Axis.XP.rotationDegrees(0F));
poseStack.mulPose(Axis.YP.rotationDegrees(r * 0F));
poseStack.mulPose(Axis.ZP.rotationDegrees(r * 0F));
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/confluence/mod/item/gun/GunItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public final class GunItems {
public static final RegistryObject<StarCannonItem> STARCANNON = ITEMS.register("starcannon", StarCannonItem::new);
public static final RegistryObject<BlowpipeItem> BLOWPIPE = ITEMS.register("blowpipe", BlowpipeItem::new);
public static final RegistryObject<BlowgunItem> BLOWGUN = ITEMS.register("blowgun", BlowgunItem::new);
public static final RegistryObject<DebugGunItem> DEBUGGUN = ITEMS.register("debuggun", DebugGunItem::new);

public static void init() {}
}
2 changes: 1 addition & 1 deletion src/main/java/org/confluence/mod/item/gun/HandGunItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player,
int r = arm == HumanoidArm.RIGHT ? 1 : -1;
poseStack.translate(r * 0.56F, -0.52F + equipProcess * -0.6F, -0.72F);

poseStack.translate(r * 0F, -0.15F, -0.1);
poseStack.translate(r * 0F, 0, 0);
poseStack.mulPose(Axis.XP.rotationDegrees(0F));
poseStack.mulPose(Axis.YP.rotationDegrees(r * 0F));
poseStack.mulPose(Axis.ZP.rotationDegrees(r * 0F));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player,
int r = arm == HumanoidArm.RIGHT ? 1 : -1;
poseStack.translate(r * 0.56F, -0.52F + equipProcess * -0.6F, -0.72F);

poseStack.translate(r * 0F, -0.15F, -0.1);
poseStack.translate(r * 0F, 0, 0);
poseStack.mulPose(Axis.XP.rotationDegrees(0F));
poseStack.mulPose(Axis.YP.rotationDegrees(r * 0F));
poseStack.mulPose(Axis.ZP.rotationDegrees(r * 0F));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player,
int r = arm == HumanoidArm.RIGHT ? 1 : -1;
poseStack.translate(r * 0.56F, -0.52F + equipProcess * -0.6F, -0.72F);

poseStack.translate(r * 0F, -0.15F, -0.1);
poseStack.translate(r * 0F, 0, 0);
poseStack.mulPose(Axis.XP.rotationDegrees(0F));
poseStack.mulPose(Axis.YP.rotationDegrees(r * 0F));
poseStack.mulPose(Axis.ZP.rotationDegrees(r * 0F));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player,
int r = arm == HumanoidArm.RIGHT ? 1 : -1;
poseStack.translate(r * 0.56F, -0.52F + equipProcess * -0.6F, -0.72F);

poseStack.translate(r * 0F, -0.15F, -0.1);
poseStack.translate(r * 0F, 0, 0);
poseStack.mulPose(Axis.XP.rotationDegrees(0F));
poseStack.mulPose(Axis.YP.rotationDegrees(r * 0F));
poseStack.mulPose(Axis.ZP.rotationDegrees(r * 0F));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player,
int r = arm == HumanoidArm.RIGHT ? 1 : -1;
poseStack.translate(r * 0.56F, -0.52F + equipProcess * -0.6F, -0.72F);

poseStack.translate(r * 0F, -0.15F, -0.1);
poseStack.translate(r * 0F, 0, 0);
poseStack.mulPose(Axis.XP.rotationDegrees(0F));
poseStack.mulPose(Axis.YP.rotationDegrees(r * 0F));
poseStack.mulPose(Axis.ZP.rotationDegrees(r * 0F));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player,
int r = arm == HumanoidArm.RIGHT ? 1 : -1;
poseStack.translate(r * 0.56F, -0.52F + equipProcess * -0.6F, -0.72F);

poseStack.translate(r * 0F, -0.15F, -0.1);
poseStack.translate(r * 0F, 0, 0);
poseStack.mulPose(Axis.XP.rotationDegrees(0F));
poseStack.mulPose(Axis.YP.rotationDegrees(r * 0F));
poseStack.mulPose(Axis.ZP.rotationDegrees(r * 0F));
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/confluence/mod/item/gun/ShotgunItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player,
int r = arm == HumanoidArm.RIGHT ? 1 : -1;
poseStack.translate(r * 0.56F, -0.52F + equipProcess * -0.6F, -0.72F);

poseStack.translate(r * 0F, -0.15F, -0.1);
poseStack.translate(r * 0F, 0, 0);
poseStack.mulPose(Axis.XP.rotationDegrees(0F));
poseStack.mulPose(Axis.YP.rotationDegrees(r * 0F));
poseStack.mulPose(Axis.ZP.rotationDegrees(r * 0F));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player,
int r = arm == HumanoidArm.RIGHT ? 1 : -1;
poseStack.translate(r * 0.56F, -0.52F + equipProcess * -0.6F, -0.72F);

poseStack.translate(r * 0F, -0.15F, -0.1);
poseStack.translate(r * 0F, 0, 0);
poseStack.mulPose(Axis.XP.rotationDegrees(0F));
poseStack.mulPose(Axis.YP.rotationDegrees(r * 0F));
poseStack.mulPose(Axis.ZP.rotationDegrees(r * 0F));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player,
int r = arm == HumanoidArm.RIGHT ? 1 : -1;
poseStack.translate(r * 0.56F, -0.52F + equipProcess * -0.6F, -0.72F);

poseStack.translate(r * 0F, -0.15F, -0.1);
poseStack.translate(r * 0F, 0, 0);
poseStack.mulPose(Axis.XP.rotationDegrees(0F));
poseStack.mulPose(Axis.YP.rotationDegrees(r * 0F));
poseStack.mulPose(Axis.ZP.rotationDegrees(r * 0F));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player,
int r = arm == HumanoidArm.RIGHT ? 1 : -1;
poseStack.translate(r * 0.56F, -0.52F + equipProcess * -0.6F, -0.72F);

poseStack.translate(r * 0F, -0.15F, -0.1);
poseStack.translate(r * 0F, 0, 0);
poseStack.mulPose(Axis.XP.rotationDegrees(0F));
poseStack.mulPose(Axis.YP.rotationDegrees(r * 0F));
poseStack.mulPose(Axis.ZP.rotationDegrees(r * 0F));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player,
int r = arm == HumanoidArm.RIGHT ? 1 : -1;
poseStack.translate(r * 0.56F, -0.52F + equipProcess * -0.6F, -0.72F);

poseStack.translate(r * 0F, -0.15F, -0.1);
poseStack.translate(r * 0F, 0, 0);
poseStack.mulPose(Axis.XP.rotationDegrees(0F));
poseStack.mulPose(Axis.YP.rotationDegrees(r * 0F));
poseStack.mulPose(Axis.ZP.rotationDegrees(r * 0F));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player,
int r = arm == HumanoidArm.RIGHT ? 1 : -1;
poseStack.translate(r * 0.56F, -0.52F + equipProcess * -0.6F, -0.72F);

poseStack.translate(r * 0F, -0.15F, -0.1);
poseStack.translate(r * 0F, 0, 0);
poseStack.mulPose(Axis.XP.rotationDegrees(0F));
poseStack.mulPose(Axis.YP.rotationDegrees(r * 0F));
poseStack.mulPose(Axis.ZP.rotationDegrees(r * 0F));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player,
int r = arm == HumanoidArm.RIGHT ? 1 : -1;
poseStack.translate(r * 0.56F, -0.52F + equipProcess * -0.6F, -0.72F);

poseStack.translate(r * 0F, -0.15F, -0.1);
poseStack.translate(r * 0F, 0, 0);
poseStack.mulPose(Axis.XP.rotationDegrees(0F));
poseStack.mulPose(Axis.YP.rotationDegrees(r * 0F));
poseStack.mulPose(Axis.ZP.rotationDegrees(r * 0F));
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/confluence/mod/item/gun/UZIItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player,
int r = arm == HumanoidArm.RIGHT ? 1 : -1;
poseStack.translate(r * 0.56F, -0.52F + equipProcess * -0.6F, -0.72F);

poseStack.translate(r * 0F, -0.15F, -0.1);
poseStack.translate(r * 0F, 0, 0);
poseStack.mulPose(Axis.XP.rotationDegrees(0F));
poseStack.mulPose(Axis.YP.rotationDegrees(r * 0F));
poseStack.mulPose(Axis.ZP.rotationDegrees(r * 0F));
Expand Down
Loading

0 comments on commit 557bda0

Please sign in to comment.