Skip to content

Commit

Permalink
Fix: Someone undo some field move.
Browse files Browse the repository at this point in the history
Improve: Marting car follows player's y rotation when placing. Change the background of register's screen.
Bump version to 1.4.31

Took 35 minutes
  • Loading branch information
xkball committed Nov 19, 2024
1 parent a0a6940 commit c28da7e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 40 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mod_name=Power Tool
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=GPL-3.0
# The mod version. See https://semver.org/
mod_version=1.4.30
mod_version=1.4.31
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
public class RegisterScreen extends AbstractContainerScreen<RegisterMenu> {

private static final ResourceLocation BG = ResourceLocation.fromNamespaceAndPath("powertool", "textures/gui/register.png");
private static final int TEXT_COLOR = 16777215;

private RegisterBlockEntity rbe;
private Checkbox matchData;
Expand Down Expand Up @@ -47,6 +48,8 @@ protected void init() {
if(rbe.matchDataComponents) matchData.onPress();
if(rbe.displaySupply) displaySupply.onPress();
}
matchData.textWidget.setColor(TEXT_COLOR);
displaySupply.textWidget.setColor(TEXT_COLOR);
this.addRenderableWidget(matchData);
this.addRenderableWidget(displaySupply);
}
Expand All @@ -69,8 +72,8 @@ public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partia
this.renderTooltip(guiGraphics, mouseX, mouseY);
var rev = Component.translatable("powertool.gui.register.rev");
var sup = Component.translatable("powertool.gui.register.sup");
guiGraphics.drawString(font,rev,leftPos+38-font.width(rev),topPos + 25+2,16777215,true);
guiGraphics.drawString(font,sup,leftPos+38-font.width(sup),topPos + 45+2,16777215,true);
guiGraphics.drawString(font,rev,leftPos+38-font.width(rev),topPos + 25+2,TEXT_COLOR,true);
guiGraphics.drawString(font,sup,leftPos+38-font.width(sup),topPos + 45+2,TEXT_COLOR,true);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public void appendHoverText(@NotNull ItemStack stack, @NotNull TooltipContext co
var entity = new MartingCarEntity(PowerToolEntities.MARTING.get(), level);
entity.setVariant(variant);
entity.setPos(pos.getCenter());
if(context.getPlayer() != null) entity.setYRot(context.getPlayer().getYRot());
context.getItemInHand().shrink(1);
level.addFreshEntity(entity);
}
Expand Down
37 changes: 1 addition & 36 deletions src/main/java/org/teacon/powertool/item/PowerToolItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ public class PowerToolItems {

public static final DeferredRegister<CreativeModeTab> CREATIVE_MODE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, PowerTool.MODID);

public static final DeferredRegister<DataComponentType<?>> DATA_COMPONENTS = DeferredRegister.create(Registries.DATA_COMPONENT_TYPE,PowerTool.MODID);

public static final DeferredRegister<ArmorMaterial> ARMOR_MATERIAL = DeferredRegister.create(Registries.ARMOR_MATERIAL,PowerTool.MODID);

public static final DeferredHolder<CreativeModeTab,CreativeModeTab> THE_TAB = CREATIVE_MODE_TABS.register("tab", () -> CreativeModeTab.builder()
Expand All @@ -71,39 +69,6 @@ public class PowerToolItems {
() -> Ingredient.EMPTY,
List.of(),
0f,0f));

public static final DeferredHolder<DataComponentType<?>,DataComponentType<FenceKnotEntity.PowerToolKnotData>> KNOT_DATA = DATA_COMPONENTS.register(
"knot_data",() -> DataComponentType.<FenceKnotEntity.PowerToolKnotData>builder()
.persistent(FenceKnotEntity.PowerToolKnotData.CODEC)
.networkSynchronized(FenceKnotEntity.PowerToolKnotData.STREAM_CODEC)
.build()
);

public static final DeferredHolder<DataComponentType<?>,DataComponentType<ExamineHoloGlass.BlockTagsComponent>> BLOCK_TAGS_DATA = DATA_COMPONENTS.register(
"block_tags",() -> DataComponentType.<ExamineHoloGlass.BlockTagsComponent>builder()
.persistent(ExamineHoloGlass.BlockTagsComponent.CODEC)
.networkSynchronized(ExamineHoloGlass.BlockTagsComponent.STREAM_CODEC)
.build()
);

public static final DeferredHolder<DataComponentType<?>,DataComponentType<ExamineHoloGlass.BlockComponents>> BLOCKS_DATA = DATA_COMPONENTS.register(
"blocks_data",() -> DataComponentType.<ExamineHoloGlass.BlockComponents>builder()
.persistent(ExamineHoloGlass.BlockComponents.CODEC)
.networkSynchronized(ExamineHoloGlass.BlockComponents.STREAM_CODEC)
.build()
);

public static final DeferredHolder<DataComponentType<?>, DataComponentType<String>> COMMAND = DATA_COMPONENTS.register(
"command", () -> DataComponentType.<String>builder().persistent(Codec.STRING).build()
);

public static final DeferredHolder<DataComponentType<?>, DataComponentType<Boolean>> CONSUME = DATA_COMPONENTS.register(
"consume", () -> DataComponentType.<Boolean>builder().persistent(Codec.BOOL).build()
);

public static final DeferredHolder<DataComponentType<?>, DataComponentType<Integer>> CYCLE = DATA_COMPONENTS.register(
"cycle", () -> DataComponentType.<Integer>builder().persistent(Codec.INT).build()
);

public static DeferredHolder<Item,TonkItem> TONK,THICK_TONK,EXTRA_THICK_TONK;
public static DeferredHolder<Item,AutoVanishBoatItem> AV_OAK_BOAT,AV_SPRUCE_BOAT,AV_BIRCH_BOAT,AV_JUNGLE_BOAT,AV_ACACIA_BOAT,AV_CHERRY_BOAT,AV_DARK_OAK_BOAT,AV_MANGROVE_BOAT,AV_BAMBOO_RAFT;
Expand Down Expand Up @@ -142,7 +107,7 @@ public boolean isFoil(ItemStack stack) {
AV_BAMBOO_RAFT = ITEMS.register("auto_vanish_bamboo_raft",() -> new AutoVanishBoatItem(Boat.Type.BAMBOO));
AV_MINE_CART = ITEMS.register("auto_vanish_minecart",() -> new AutoVanishMinecartItem(new Item.Properties()));
CREATIVE_MODE_TABS.register(bus);
DATA_COMPONENTS.register(bus);
PowerToolDataComponents.DATA_COMPONENTS.register(bus);
ARMOR_MATERIAL.register(bus);
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/META-INF/accesstransformer.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ public net.minecraft.client.gui.GuiGraphics scissorStack
public net.minecraft.client.gui.GuiGraphics$ScissorStack
public net.minecraft.client.gui.GuiGraphics$ScissorStack stack
protected-f net.minecraft.world.level.block.entity.BlockEntity type
protected net.minecraft.world.item.BoatItem getBoat(Lnet/minecraft/world/level/Level;Lnet/minecraft/world/phys/HitResult;Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/entity/player/Player;)Lnet/minecraft/world/entity/vehicle/Boat;
protected net.minecraft.world.item.BoatItem getBoat(Lnet/minecraft/world/level/Level;Lnet/minecraft/world/phys/HitResult;Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/entity/player/Player;)Lnet/minecraft/world/entity/vehicle/Boat;
public net.minecraft.client.gui.components.Checkbox textWidget

0 comments on commit c28da7e

Please sign in to comment.