From cf3ef8c2294fa607e1a049274764c39ec75fbd93 Mon Sep 17 00:00:00 2001 From: PepperBell <44146161+PepperCode1@users.noreply.github.com> Date: Thu, 8 Jul 2021 11:17:35 -0700 Subject: [PATCH] Fix saw blade culling - Remove AllColorHandlers as it was empty - Organize imports --- .../java/com/simibubi/create/AllColorHandlers.java | 0 src/main/java/com/simibubi/create/AllItems.java | 2 +- src/main/java/com/simibubi/create/compat/Mods.java | 4 ++-- .../components/actors/HarvesterTileEntity.java | 3 +++ .../components/actors/SawMovementBehaviour.java | 6 +++--- .../contraptions/components/saw/SawTileEntity.java | 10 ++++++++++ .../processing/ProcessingRecipeBuilder.java | 1 - .../content/logistics/item/filter/ItemAttribute.java | 3 +-- .../simibubi/create/foundation/utility/TreeCutter.java | 2 -- 9 files changed, 20 insertions(+), 11 deletions(-) delete mode 100644 src/main/java/com/simibubi/create/AllColorHandlers.java diff --git a/src/main/java/com/simibubi/create/AllColorHandlers.java b/src/main/java/com/simibubi/create/AllColorHandlers.java deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/main/java/com/simibubi/create/AllItems.java b/src/main/java/com/simibubi/create/AllItems.java index de9051c5e..8e7c0bea4 100644 --- a/src/main/java/com/simibubi/create/AllItems.java +++ b/src/main/java/com/simibubi/create/AllItems.java @@ -1,10 +1,10 @@ package com.simibubi.create; +import static com.simibubi.create.AllTags.forgeItemTag; import static com.simibubi.create.AllTags.AllItemTags.CREATE_INGOTS; import static com.simibubi.create.AllTags.AllItemTags.CRUSHED_ORES; import static com.simibubi.create.AllTags.AllItemTags.NUGGETS; import static com.simibubi.create.AllTags.AllItemTags.PLATES; -import static com.simibubi.create.AllTags.forgeItemTag; import static com.simibubi.create.content.AllSections.CURIOSITIES; import static com.simibubi.create.content.AllSections.KINETICS; import static com.simibubi.create.content.AllSections.LOGISTICS; diff --git a/src/main/java/com/simibubi/create/compat/Mods.java b/src/main/java/com/simibubi/create/compat/Mods.java index cf9ec4e2a..85b23626a 100644 --- a/src/main/java/com/simibubi/create/compat/Mods.java +++ b/src/main/java/com/simibubi/create/compat/Mods.java @@ -1,10 +1,10 @@ package com.simibubi.create.compat; -import net.minecraftforge.fml.ModList; - import java.util.Optional; import java.util.function.Supplier; +import net.minecraftforge.fml.ModList; + /** * For compatibility with and without another mod present, we have to define load conditions of the specific code */ diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterTileEntity.java index f76448e23..cd10367d2 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterTileEntity.java @@ -4,6 +4,8 @@ import com.simibubi.create.foundation.tileEntity.SyncedTileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.math.AxisAlignedBB; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; public class HarvesterTileEntity extends SyncedTileEntity { @@ -17,6 +19,7 @@ public class HarvesterTileEntity extends SyncedTileEntity { } @Override + @OnlyIn(Dist.CLIENT) public AxisAlignedBB getRenderBoundingBox() { return RENDER_BOX.offset(pos); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/SawMovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/SawMovementBehaviour.java index 77aebb0c3..d3a78dc13 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/SawMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/SawMovementBehaviour.java @@ -1,11 +1,13 @@ package com.simibubi.create.content.contraptions.components.actors; +import java.util.Optional; + import com.simibubi.create.content.contraptions.components.saw.SawBlock; import com.simibubi.create.content.contraptions.components.saw.SawRenderer; import com.simibubi.create.content.contraptions.components.saw.SawTileEntity; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; -import com.simibubi.create.foundation.utility.AbstractBlockBreakQueue; import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices; +import com.simibubi.create.foundation.utility.AbstractBlockBreakQueue; import com.simibubi.create.foundation.utility.TreeCutter; import com.simibubi.create.foundation.utility.VecHelper; import com.simibubi.create.foundation.utility.worldWrappers.PlacementSimulationWorld; @@ -24,8 +26,6 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.items.ItemHandlerHelper; -import java.util.Optional; - public class SawMovementBehaviour extends BlockBreakingMovementBehaviour { @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java index 6ba7308cb..5eeb534f1 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java @@ -56,6 +56,7 @@ import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; import net.minecraft.util.LazyValue; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.vector.Vector3d; @@ -71,6 +72,8 @@ import net.minecraftforge.items.IItemHandler; @MethodsReturnNonnullByDefault public class SawTileEntity extends BlockBreakingKineticTileEntity { + private static final AxisAlignedBB RENDER_BOX = new AxisAlignedBB(0, 0, 0, 1, 1, 1); + private static final Object cuttingRecipesKey = new Object(); public static final LazyValue> woodcuttingRecipeType = new LazyValue<>(() -> Registry.RECIPE_TYPE.getOrDefault(new ResourceLocation("druidcraft", "woodcutting"))); @@ -120,6 +123,13 @@ public class SawTileEntity extends BlockBreakingKineticTileEntity { playEvent = ItemStack.read(compound.getCompound("PlayEvent")); } + @Override + protected AxisAlignedBB makeRenderBoundingBox() { + Direction facing = getBlockState().get(SawBlock.FACING); + AxisAlignedBB box = RENDER_BOX.expand(facing.getXOffset() * 0.125f, facing.getYOffset() * 0.125f, facing.getZOffset() * 0.125f); + return box.offset(pos); + } + @Override @OnlyIn(Dist.CLIENT) public void tickAudio() { diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeBuilder.java b/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeBuilder.java index 305d5e06a..16f747acb 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeBuilder.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeBuilder.java @@ -7,7 +7,6 @@ import java.util.function.Consumer; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.simibubi.create.AllRecipeTypes; -import com.simibubi.create.Create; import com.simibubi.create.foundation.fluid.FluidHelper; import com.simibubi.create.foundation.fluid.FluidIngredient; import com.simibubi.create.foundation.utility.Lang; diff --git a/src/main/java/com/simibubi/create/content/logistics/item/filter/ItemAttribute.java b/src/main/java/com/simibubi/create/content/logistics/item/filter/ItemAttribute.java index 967896313..beb7a8946 100644 --- a/src/main/java/com/simibubi/create/content/logistics/item/filter/ItemAttribute.java +++ b/src/main/java/com/simibubi/create/content/logistics/item/filter/ItemAttribute.java @@ -9,8 +9,6 @@ import java.util.function.BiPredicate; import java.util.function.Predicate; import java.util.stream.Collectors; -import com.simibubi.create.content.logistics.item.filter.attribute.ShulkerFillLevelAttribute; - import org.apache.commons.lang3.StringUtils; import com.simibubi.create.AllRecipeTypes; @@ -21,6 +19,7 @@ import com.simibubi.create.content.logistics.item.filter.attribute.ColorAttribut import com.simibubi.create.content.logistics.item.filter.attribute.EnchantAttribute; import com.simibubi.create.content.logistics.item.filter.attribute.FluidContentsAttribute; import com.simibubi.create.content.logistics.item.filter.attribute.ItemNameAttribute; +import com.simibubi.create.content.logistics.item.filter.attribute.ShulkerFillLevelAttribute; import com.simibubi.create.content.logistics.item.filter.attribute.astralsorcery.AstralSorceryAmuletAttribute; import com.simibubi.create.content.logistics.item.filter.attribute.astralsorcery.AstralSorceryAttunementAttribute; import com.simibubi.create.content.logistics.item.filter.attribute.astralsorcery.AstralSorceryCrystalAttribute; diff --git a/src/main/java/com/simibubi/create/foundation/utility/TreeCutter.java b/src/main/java/com/simibubi/create/foundation/utility/TreeCutter.java index 598ec71cd..3b7f6e5ea 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/TreeCutter.java +++ b/src/main/java/com/simibubi/create/foundation/utility/TreeCutter.java @@ -14,9 +14,7 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import com.simibubi.create.AllTags; - import com.simibubi.create.compat.Mods; - import com.simibubi.create.compat.dynamictrees.DynamicTree; import net.minecraft.block.BambooBlock;