Skip to content

Commit e34216d

Browse files
committed
Improve: Trash can will clear itself when reload chunk.
Fix: missing attribute in marting car. Bump Version to 1.4.46 Took 53 minutes
1 parent a289f1d commit e34216d

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ mod_name=Power Tool
3434
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
3535
mod_license=GPL-3.0
3636
# The mod version. See https://semver.org/
37-
mod_version=1.4.45
37+
mod_version=1.4.46
3838
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
3939
# This should match the base package used for the mod sources.
4040
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html

src/main/java/org/teacon/powertool/block/entity/TrashCanWithContainerBlockEntity.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
public class TrashCanWithContainerBlockEntity extends BaseContainerBlockEntity {
2323

2424
private NonNullList<ItemStack> items = NonNullList.withSize(1, ItemStack.EMPTY);
25+
private boolean init = false;
2526

2627
public TrashCanWithContainerBlockEntity(BlockPos pos, BlockState blockState) {
2728
super(PowerToolBlocks.TRASH_CAN_WITH_CONTAINER_BLOCK_ENTITY.get(), pos, blockState);
@@ -61,6 +62,10 @@ public int getContainerSize() {
6162
protected void loadAdditional(CompoundTag tag, HolderLookup.Provider registries) {
6263
super.loadAdditional(tag, registries);
6364
ContainerHelper.loadAllItems(tag, this.items, registries);
65+
if(!this.init){
66+
items.clear();
67+
init = true;
68+
}
6469
}
6570

6671
@Override

src/main/java/org/teacon/powertool/client/renders/holo_sign/HolographicSignBlockEntityRenderer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public static void renderText(Font font, Component component, float x, float y,
102102
Matrix4f matrix4f = new Matrix4f(matrix);
103103
renderBackground(font,backgroundColor,packedLightCoords,x,y,font.width(component),dropShadow,matrix4f,buffer);
104104
if (dropShadow) {
105-
font.drawInBatch(text, x, y, color, true, matrix, buffer, Font.DisplayMode.NORMAL,VanillaUtils.TRANSPARENT , packedLightCoords);
105+
font.drawInBatch(text, x, y, color, true, matrix, buffer, Font.DisplayMode.SEE_THROUGH,VanillaUtils.TRANSPARENT , packedLightCoords);
106106
matrix4f.translate(SHADOW_OFFSET);
107107
}
108108
font.drawInBatch(text, x, y, color, false, matrix4f, buffer, Font.DisplayMode.NORMAL, VanillaUtils.TRANSPARENT, packedLightCoords);
@@ -122,7 +122,7 @@ public static void renderText(Font font,String text,float x, float y, int color,
122122
}
123123

124124
public static void renderBackground(Font font,int backgroundColor, int packedLightCoords,float x,float y,int length,boolean append,Matrix4f matrix, MultiBufferSource buffer){
125-
if (backgroundColor != 0) {
125+
if (backgroundColor != 0 && backgroundColor != VanillaUtils.TRANSPARENT) {
126126
float f = (float)(backgroundColor >> 24 & 0xFF) / 255.0F;
127127
float f1 = (float)(backgroundColor >> 16 & 0xFF) / 255.0F;
128128
float f2 = (float)(backgroundColor >> 8 & 0xFF) / 255.0F;

src/main/java/org/teacon/powertool/entity/MartingCarEntity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ public void setDamage(float value) {
324324
}
325325

326326
public static AttributeSupplier createAttributes() {
327-
return AttributeSupplier.builder()
327+
return LivingEntity.createLivingAttributes()
328328
.add(Attributes.MAX_HEALTH, 1)
329329
.add(Attributes.STEP_HEIGHT, 1)
330330
.add(Attributes.MOVEMENT_SPEED, 0.7)

0 commit comments

Comments
 (0)