Skip to content

Commit

Permalink
Limiting the infinite
Browse files Browse the repository at this point in the history
- Add new config and tags for better control over infinite draining
behaviour
- Pipes spilling water will now extinguish entities and fires; pipes
spilling lava will now set entities on fire
- Fix some bugs and inconvenient behavior with the config menus
- Fix fluids destroying crushing wheel controllers
- Fix crushing wheel controller using output direction instead of input
direction at times
- Rename blaze burner fuel tags
- Improve GhostBlockRenderer
- Organize imports
- Update Forge
  • Loading branch information
PepperCode1 committed Mar 5, 2022
1 parent 97ea78e commit fa4a0e7
Show file tree
Hide file tree
Showing 36 changed files with 356 additions and 311 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ org.gradle.daemon = false
# mod version info
mod_version = 0.4d
minecraft_version = 1.18.1
forge_version = 39.0.59
forge_version = 39.1.0

# build dependency versions
forgegradle_version = 5.1.+
Expand Down
9 changes: 5 additions & 4 deletions src/generated/resources/.cache/cache
Original file line number Diff line number Diff line change
Expand Up @@ -2126,7 +2126,7 @@ d080b1b25e5bc8baf5aee68691b08c7f12ece3b0 assets/create/models/item/windmill_bear
a80fb25a0b655e76be986b5b49fcb0f03461a1ab assets/create/models/item/zinc_nugget.json
b1689617190c05ef34bd18456b0c7ae09bb3210f assets/create/models/item/zinc_ore.json
5049f72c327a88f175f6f9425909e098fc711100 assets/create/sounds.json
5d0cc4c0255dc241e61c173b31ddca70c88d08e4 data/create/advancements/aesthetics.json
0f1b4b980afba9bf2caf583b88e261bba8b10313 data/create/advancements/aesthetics.json
613e64b44bed959da899fdd54c1cacb227fb33f2 data/create/advancements/andesite_alloy.json
81885c6bfb85792c88aaa7c9b70f58832945d31f data/create/advancements/andesite_casing.json
83c046bd200623933545c9e4326f782fb02c87fa data/create/advancements/arm_blaze_burner.json
Expand Down Expand Up @@ -3339,7 +3339,6 @@ c633372228a13023f9dde2cd3478a7dc90affcea data/create/loot_tables/blocks/crimsite
62800d2baf79e7a45b246896f2679fd6f5082efe data/create/loot_tables/blocks/crimson_window.json
572dfdf4daaaf2c97882f3b2a856737365bf5873 data/create/loot_tables/blocks/crimson_window_pane.json
3503b55a82b94ddaeebbc510eece2cc313c33e43 data/create/loot_tables/blocks/crushing_wheel.json
5c1df8443043b3fe3b665dba348e2ff188bcbe31 data/create/loot_tables/blocks/crushing_wheel_controller.json
252a6476bd2dd730dd97afbf2c69d9627f0d1672 data/create/loot_tables/blocks/cuckoo_clock.json
838c008dc2881fbb4136773b3c84c3d988483f73 data/create/loot_tables/blocks/cut_andesite.json
accd5aecce569330b1821d12f031a68259a42f27 data/create/loot_tables/blocks/cut_andesite_brick_slab.json
Expand Down Expand Up @@ -5194,8 +5193,10 @@ d063e12c9ef75f39518c6d129ea35d833464d547 data/create/tags/blocks/toolboxes.json
eac71740fb12bdb38b5dfaa2268613d7ba82b809 data/create/tags/blocks/windmill_sails.json
74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/create/tags/blocks/windowable.json
893a01e6004d6d8272bd1658e98da88bb572ee57 data/create/tags/blocks/wrench_pickup.json
74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/create/tags/items/blaze_burner_regular_fuel.json
97061ef67cac1fafd869493d06115b968bcb99bf data/create/tags/items/blaze_burner_special_fuel.json
a8bdc387cfa6296ebcc4af14323e2ddb632234dc data/create/tags/fluids/bottomless/allow.json
74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/create/tags/fluids/bottomless/deny.json
74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/create/tags/items/blaze_burner_fuel/regular.json
97061ef67cac1fafd869493d06115b968bcb99bf data/create/tags/items/blaze_burner_fuel/special.json
5212172aee2239136c94f9868ad39ec2e17cf1c6 data/create/tags/items/create_ingots.json
4480f211f4a37bfee193eba945bc9f5a8d2c6e34 data/create/tags/items/crushed_ores.json
bce28787b0271382842823d04a977912a88b01c2 data/create/tags/items/sandpaper.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"trigger": "create:bracket_apply",
"conditions": {
"accepted_entries": [
"create:large_cogwheel",
"create:cogwheel"
"create:cogwheel",
"create:large_cogwheel"
]
}
},
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"minecraft:water",
"minecraft:lava"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"replace": false,
"values": []
}
7 changes: 4 additions & 3 deletions src/main/java/com/simibubi/create/AllBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ public class AllBlocks {
.register();

public static final BlockEntry<BeltBlock> BELT = REGISTRATE.block("belt", BeltBlock::new)
.initialProperties(SharedProperties.beltMaterial, MaterialColor.COLOR_GRAY)
.initialProperties(SharedProperties.BELT_MATERIAL, MaterialColor.COLOR_GRAY)
.properties(p -> p.sound(SoundType.WOOL))
.properties(p -> p.strength(0.8F))
.transform(axeOrPickaxe())
Expand Down Expand Up @@ -506,7 +506,8 @@ public class AllBlocks {

public static final BlockEntry<CrushingWheelControllerBlock> CRUSHING_WHEEL_CONTROLLER =
REGISTRATE.block("crushing_wheel_controller", CrushingWheelControllerBlock::new)
.initialProperties(() -> Blocks.AIR)
.initialProperties(SharedProperties.CRUSHING_WHEEL_CONTROLLER_MATERIAL)
.properties(p -> p.noOcclusion().noDrops().air())
.blockstate((c, p) -> p.getVariantBuilder(c.get())
.forAllStatesExcept(state -> ConfiguredModel.builder()
.modelFile(p.models()
Expand Down Expand Up @@ -909,7 +910,7 @@ public class AllBlocks {
.register();

public static final BlockEntry<PulleyBlock.RopeBlock> ROPE = REGISTRATE.block("rope", PulleyBlock.RopeBlock::new)
.initialProperties(SharedProperties.beltMaterial, MaterialColor.COLOR_BROWN)
.initialProperties(SharedProperties.BELT_MATERIAL, MaterialColor.COLOR_BROWN)
.tag(AllBlockTags.BRITTLE.tag)
.properties(p -> p.sound(SoundType.WOOL))
.blockstate((c, p) -> p.simpleBlock(c.get(), p.models()
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/simibubi/create/AllItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public class AllItems {
.register();

public static final ItemEntry<CombustibleItem> BLAZE_CAKE = REGISTRATE.item("blaze_cake", CombustibleItem::new)
.tag(AllItemTags.BLAZE_BURNER_SPECIAL_FUEL.tag, AllItemTags.UPRIGHT_ON_BELT.tag)
.tag(AllItemTags.BLAZE_BURNER_FUEL_SPECIAL.tag, AllItemTags.UPRIGHT_ON_BELT.tag)
.onRegister(i -> i.setBurnTime(6400))
.register();

Expand Down
16 changes: 9 additions & 7 deletions src/main/java/com/simibubi/create/AllTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.material.Fluids;
import net.minecraftforge.common.Tags;

public class AllTags {
Expand Down Expand Up @@ -81,7 +82,9 @@ public static <T extends Block, P> NonNullFunction<BlockBuilder<T, P>, ItemBuild

public enum NameSpace {

MOD(Create.ID, false, true), FORGE("forge"), TIC("tconstruct")
MOD(Create.ID, false, true),
FORGE("forge"),
TIC("tconstruct")

;

Expand Down Expand Up @@ -183,8 +186,8 @@ public void includeAll(Tag.Named<Block> child) {

public enum AllItemTags {

BLAZE_BURNER_REGULAR_FUEL,
BLAZE_BURNER_SPECIAL_FUEL,
BLAZE_BURNER_FUEL_REGULAR(MOD, "blaze_burner_fuel/regular"),
BLAZE_BURNER_FUEL_SPECIAL(MOD, "blaze_burner_fuel/special"),
CREATE_INGOTS,
CRUSHED_ORES,
SANDPAPER,
Expand Down Expand Up @@ -255,7 +258,8 @@ public void includeAll(Tag.Named<Item> child) {

public enum AllFluidTags {

NO_INFINITE_DRAINING(MOD, true, false),
BOTTOMLESS_ALLOW(MOD, "bottomless/allow"),
BOTTOMLESS_DENY(MOD, "bottomless/deny"),

HONEY(FORGE)

Expand Down Expand Up @@ -314,12 +318,10 @@ public void includeAll(Tag.Named<Fluid> child) {
.addTag(child));
}

private static void loadClass() {}

}

public static void register() {
AllFluidTags.loadClass();
AllFluidTags.BOTTOMLESS_ALLOW.add(Fluids.WATER, Fluids.LAVA);

AllItemTags.CREATE_INGOTS.includeIn(AllItemTags.BEACON_PAYMENT);
AllItemTags.CREATE_INGOTS.includeIn(Tags.Items.INGOTS);
Expand Down
58 changes: 44 additions & 14 deletions src/main/java/com/simibubi/create/compat/jei/CreateJEI.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,42 @@
package com.simibubi.create.compat.jei;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.stream.Collectors;

import javax.annotation.Nonnull;

import com.google.common.base.Predicates;
import com.simibubi.create.*;
import com.simibubi.create.compat.jei.category.*;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllFluids;
import com.simibubi.create.AllItems;
import com.simibubi.create.AllRecipeTypes;
import com.simibubi.create.Create;
import com.simibubi.create.compat.jei.category.BlockCuttingCategory;
import com.simibubi.create.compat.jei.category.BlockCuttingCategory.CondensedBlockCuttingRecipe;
import com.simibubi.create.compat.jei.category.CreateRecipeCategory;
import com.simibubi.create.compat.jei.category.CrushingCategory;
import com.simibubi.create.compat.jei.category.DeployingCategory;
import com.simibubi.create.compat.jei.category.FanBlastingCategory;
import com.simibubi.create.compat.jei.category.FanHauntingCategory;
import com.simibubi.create.compat.jei.category.FanSmokingCategory;
import com.simibubi.create.compat.jei.category.FanWashingCategory;
import com.simibubi.create.compat.jei.category.ItemDrainCategory;
import com.simibubi.create.compat.jei.category.MechanicalCraftingCategory;
import com.simibubi.create.compat.jei.category.MillingCategory;
import com.simibubi.create.compat.jei.category.MixingCategory;
import com.simibubi.create.compat.jei.category.MysteriousItemConversionCategory;
import com.simibubi.create.compat.jei.category.PackingCategory;
import com.simibubi.create.compat.jei.category.PolishingCategory;
import com.simibubi.create.compat.jei.category.PressingCategory;
import com.simibubi.create.compat.jei.category.ProcessingViaFanCategory;
import com.simibubi.create.compat.jei.category.SawingCategory;
import com.simibubi.create.compat.jei.category.SequencedAssemblyCategory;
import com.simibubi.create.compat.jei.category.SpoutCategory;
import com.simibubi.create.content.contraptions.components.crafter.MechanicalCraftingRecipe;
import com.simibubi.create.content.contraptions.components.deployer.DeployerApplicationRecipe;
import com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity;
Expand All @@ -23,27 +56,24 @@
import mezz.jei.api.IModPlugin;
import mezz.jei.api.JeiPlugin;
import mezz.jei.api.constants.VanillaRecipeCategoryUid;
import mezz.jei.api.registration.*;
import mezz.jei.api.registration.IGuiHandlerRegistration;
import mezz.jei.api.registration.IRecipeCatalystRegistration;
import mezz.jei.api.registration.IRecipeCategoryRegistration;
import mezz.jei.api.registration.IRecipeRegistration;
import mezz.jei.api.registration.IRecipeTransferRegistration;
import mezz.jei.api.registration.ISubtypeRegistration;
import mezz.jei.api.runtime.IIngredientManager;
import net.minecraft.client.Minecraft;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.crafting.*;
import net.minecraft.world.item.crafting.CraftingRecipe;
import net.minecraft.world.item.crafting.Recipe;
import net.minecraft.world.item.crafting.RecipeType;
import net.minecraft.world.level.ItemLike;
import net.minecraftforge.common.crafting.IShapedRecipe;
import net.minecraftforge.fml.ModList;

import javax.annotation.Nonnull;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.stream.Collectors;

@JeiPlugin
@SuppressWarnings("unused")
public class CreateJEI implements IModPlugin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.item.crafting.CraftingRecipe;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.item.crafting.ShapedRecipe;
import net.minecraftforge.common.crafting.IShapedRecipe;

public class MechanicalCraftingCategory extends CreateRecipeCategory<CraftingRecipe> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private boolean supportsDirectBeltInput(Direction side) {
if (blockState == null)
return false;
Direction direction = blockState.getValue(CrushingWheelControllerBlock.FACING);
return direction == Direction.DOWN || direction == side;
return direction == Direction.DOWN || direction.getOpposite() == side;
}

@Override
Expand Down Expand Up @@ -144,21 +144,21 @@ public void tick() {
inventory.remainingTime = 0;

// Output Items
if (facing.getAxis()
.isHorizontal() || facing == Direction.DOWN) {
if (facing != Direction.UP) {
Direction inputDir = facing.getOpposite();
BlockPos nextPos = worldPosition.offset(facing.getAxis() == Axis.X ? 1f * offset : 0f, (-1f),
facing.getAxis() == Axis.Z ? 1f * offset : 0f);
DirectBeltInputBehaviour behaviour =
TileEntityBehaviour.get(level, nextPos, DirectBeltInputBehaviour.TYPE);
if (behaviour != null) {
boolean changed = false;
if (!behaviour.canInsertFromSide(facing))
if (!behaviour.canInsertFromSide(inputDir))
return;
for (int slot = 0; slot < inventory.getSlots(); slot++) {
ItemStack stack = inventory.getStackInSlot(slot);
if (stack.isEmpty())
continue;
ItemStack remainder = behaviour.handleInsertion(stack, facing, false);
ItemStack remainder = behaviour.handleInsertion(stack, inputDir, false);
if (remainder.equals(stack, false))
continue;
inventory.setStackInSlot(slot, remainder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.CraftingRecipe;
import net.minecraft.world.item.crafting.Recipe;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.AABB;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public static void glueInOffHandAppliesOnBlockPlace(EntityPlaceEvent event, Bloc
if (!world.isClientSide) {
entity.playPlaceSound();
world.addFreshEntity(entity);
AllPackets.channel.send(PacketDistributor.TRACKING_ENTITY_AND_SELF.with(() -> entity),
AllPackets.channel.send(PacketDistributor.TRACKING_ENTITY.with(() -> entity),
new GlueEffectPacket(ray.getBlockPos(), face, true));
}
itemstack.hurtAndBreak(1, placer, SuperGlueItem::onBroken);
Expand Down
Loading

0 comments on commit fa4a0e7

Please sign in to comment.