The Unseatable

- Fixed Smart observers not activated by funnels when facing up or down
- Added the entity type tag `#create:ignore_seat`
- Added a config option to prevent hostile mobs from getting picked up by seats
- Fixed item slots of powered and unpowered redstone link models not matching in size
- Fixed incorrect reflection access in track placement overlay
This commit is contained in:
simibubi 2023-07-03 15:28:10 +02:00
parent a947a06263
commit e42fba6341
12 changed files with 107 additions and 25 deletions

View file

@ -5336,6 +5336,7 @@ ad8fa04f7bbbafd70d0ce158af78a35e899301e2 data/create/tags/blocks/tracks.json
50936b211d94167a35ec78c89954082a336b6269 data/create/tags/blocks/valve_handles.json 50936b211d94167a35ec78c89954082a336b6269 data/create/tags/blocks/valve_handles.json
eac71740fb12bdb38b5dfaa2268613d7ba82b809 data/create/tags/blocks/windmill_sails.json eac71740fb12bdb38b5dfaa2268613d7ba82b809 data/create/tags/blocks/windmill_sails.json
9851b3bef451f326ef322a31f85b9a970859590d data/create/tags/blocks/wrench_pickup.json 9851b3bef451f326ef322a31f85b9a970859590d data/create/tags/blocks/wrench_pickup.json
74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/create/tags/entity_types/ignore_seat.json
a8bdc387cfa6296ebcc4af14323e2ddb632234dc data/create/tags/fluids/bottomless/allow.json a8bdc387cfa6296ebcc4af14323e2ddb632234dc data/create/tags/fluids/bottomless/allow.json
74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/create/tags/fluids/bottomless/deny.json 74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/create/tags/fluids/bottomless/deny.json
74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/create/tags/items/blaze_burner_fuel/regular.json 74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/create/tags/items/blaze_burner_fuel/regular.json

View file

@ -0,0 +1,4 @@
{
"replace": false,
"values": []
}

View file

@ -9,11 +9,14 @@ import java.util.Collections;
import com.simibubi.create.foundation.utility.Lang; import com.simibubi.create.foundation.utility.Lang;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.BlockTags; import net.minecraft.tags.BlockTags;
import net.minecraft.tags.FluidTags; import net.minecraft.tags.FluidTags;
import net.minecraft.tags.ItemTags; import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey; import net.minecraft.tags.TagKey;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
@ -49,6 +52,7 @@ public class AllTags {
} }
public enum NameSpace { public enum NameSpace {
MOD(Create.ID, false, true), MOD(Create.ID, false, true),
FORGE("forge"), FORGE("forge"),
TIC("tconstruct"), TIC("tconstruct"),
@ -72,6 +76,7 @@ public class AllTags {
} }
public enum AllBlockTags { public enum AllBlockTags {
BRITTLE, BRITTLE,
CASING, CASING,
FAN_TRANSPARENT, FAN_TRANSPARENT,
@ -143,11 +148,12 @@ public class AllTags {
return state.is(tag); return state.is(tag);
} }
private static void init() { private static void init() {}
}
} }
public enum AllItemTags { public enum AllItemTags {
BLAZE_BURNER_FUEL_REGULAR(MOD, "blaze_burner_fuel/regular"), BLAZE_BURNER_FUEL_REGULAR(MOD, "blaze_burner_fuel/regular"),
BLAZE_BURNER_FUEL_SPECIAL(MOD, "blaze_burner_fuel/special"), BLAZE_BURNER_FUEL_SPECIAL(MOD, "blaze_burner_fuel/special"),
CASING, CASING,
@ -213,11 +219,12 @@ public class AllTags {
return stack.is(tag); return stack.is(tag);
} }
private static void init() { private static void init() {}
}
} }
public enum AllFluidTags { public enum AllFluidTags {
BOTTOMLESS_ALLOW(MOD, "bottomless/allow"), BOTTOMLESS_ALLOW(MOD, "bottomless/allow"),
BOTTOMLESS_DENY(MOD, "bottomless/deny"), BOTTOMLESS_DENY(MOD, "bottomless/deny"),
@ -263,13 +270,58 @@ public class AllTags {
return state.is(tag); return state.is(tag);
} }
private static void init() { private static void init() {}
} }
public enum AllEntityTags {
IGNORE_SEAT,
;
public final TagKey<EntityType<?>> tag;
public final boolean alwaysDatagen;
AllEntityTags() {
this(MOD);
}
AllEntityTags(NameSpace namespace) {
this(namespace, namespace.optionalDefault, namespace.alwaysDatagenDefault);
}
AllEntityTags(NameSpace namespace, String path) {
this(namespace, path, namespace.optionalDefault, namespace.alwaysDatagenDefault);
}
AllEntityTags(NameSpace namespace, boolean optional, boolean alwaysDatagen) {
this(namespace, null, optional, alwaysDatagen);
}
AllEntityTags(NameSpace namespace, String path, boolean optional, boolean alwaysDatagen) {
ResourceLocation id = new ResourceLocation(namespace.id, path == null ? Lang.asId(name()) : path);
if (optional) {
tag = optionalTag(ForgeRegistries.ENTITIES, id);
} else {
tag = TagKey.create(Registry.ENTITY_TYPE_REGISTRY, id);
}
this.alwaysDatagen = alwaysDatagen;
}
public boolean matches(Entity entity) {
return entity.getType()
.is(tag);
}
private static void init() {}
} }
public static void init() { public static void init() {
AllBlockTags.init(); AllBlockTags.init();
AllItemTags.init(); AllItemTags.init();
AllFluidTags.init(); AllFluidTags.init();
AllEntityTags.init();
} }
} }

View file

@ -8,8 +8,10 @@ import javax.annotation.ParametersAreNonnullByDefault;
import com.google.common.base.Optional; import com.google.common.base.Optional;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllShapes; import com.simibubi.create.AllShapes;
import com.simibubi.create.AllTags.AllEntityTags;
import com.simibubi.create.foundation.block.ProperWaterloggedBlock; import com.simibubi.create.foundation.block.ProperWaterloggedBlock;
import com.simibubi.create.foundation.utility.BlockHelper; import com.simibubi.create.foundation.utility.BlockHelper;
import com.simibubi.create.infrastructure.config.AllConfigs;
import net.minecraft.MethodsReturnNonnullByDefault; import net.minecraft.MethodsReturnNonnullByDefault;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
@ -189,6 +191,12 @@ public class SeatBlock extends Block implements ProperWaterloggedBlock {
return false; return false;
if (passenger instanceof Player) if (passenger instanceof Player)
return false; return false;
if (AllEntityTags.IGNORE_SEAT.matches(passenger))
return false;
if (!AllConfigs.server().logistics.seatHostileMobs.get() && !passenger.getType()
.getCategory()
.isFriendly())
return false;
return passenger instanceof LivingEntity; return passenger instanceof LivingEntity;
} }

View file

@ -133,12 +133,12 @@ public class SmartObserverBlock extends DirectedDirectionalBlock implements IBE<
} }
public void onFunnelTransfer(Level world, BlockPos funnelPos, ItemStack transferred) { public void onFunnelTransfer(Level world, BlockPos funnelPos, ItemStack transferred) {
for (Direction direction : Iterate.horizontalDirections) { for (Direction direction : Iterate.directions) {
BlockPos detectorPos = funnelPos.relative(direction); BlockPos detectorPos = funnelPos.relative(direction);
BlockState detectorState = world.getBlockState(detectorPos); BlockState detectorState = world.getBlockState(detectorPos);
if (!AllBlocks.SMART_OBSERVER.has(detectorState)) if (!AllBlocks.SMART_OBSERVER.has(detectorState))
continue; continue;
if (detectorState.getValue(FACING) != direction.getOpposite()) if (SmartObserverBlock.getTargetDirection(detectorState) != direction.getOpposite())
continue; continue;
withBlockEntityDo(world, detectorPos, be -> { withBlockEntityDo(world, detectorPos, be -> {
FilteringBehaviour filteringBehaviour = BlockEntityBehaviour.get(be, FilteringBehaviour.TYPE); FilteringBehaviour filteringBehaviour = BlockEntityBehaviour.get(be, FilteringBehaviour.TYPE);

View file

@ -37,7 +37,7 @@ public class TrackPlacementOverlay {
return; return;
if (ObfuscationReflectionHelper.getPrivateValue(Gui.class, gui, if (ObfuscationReflectionHelper.getPrivateValue(Gui.class, gui,
"toolHighlightTimer") instanceof Integer toolHighlightTimer && toolHighlightTimer > 0) "f_92993_") instanceof Integer toolHighlightTimer && toolHighlightTimer > 0)
return; return;
boolean active = mc.options.keySprint.isDown(); boolean active = mc.options.keySprint.isDown();

View file

@ -2,6 +2,7 @@ package com.simibubi.create.foundation.data;
import com.simibubi.create.AllTags; import com.simibubi.create.AllTags;
import com.simibubi.create.AllTags.AllBlockTags; import com.simibubi.create.AllTags.AllBlockTags;
import com.simibubi.create.AllTags.AllEntityTags;
import com.simibubi.create.AllTags.AllFluidTags; import com.simibubi.create.AllTags.AllFluidTags;
import com.simibubi.create.AllTags.AllItemTags; import com.simibubi.create.AllTags.AllItemTags;
import com.simibubi.create.Create; import com.simibubi.create.Create;
@ -15,6 +16,7 @@ import com.tterrag.registrate.util.nullness.NonNullFunction;
import net.minecraft.data.tags.TagsProvider.TagAppender; import net.minecraft.data.tags.TagsProvider.TagAppender;
import net.minecraft.tags.BlockTags; import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ItemTags; import net.minecraft.tags.ItemTags;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items; import net.minecraft.world.item.Items;
@ -66,6 +68,7 @@ public class TagGen {
Create.REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, TagGen::genBlockTags); Create.REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, TagGen::genBlockTags);
Create.REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, TagGen::genItemTags); Create.REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, TagGen::genItemTags);
Create.REGISTRATE.addDataGenerator(ProviderType.FLUID_TAGS, TagGen::genFluidTags); Create.REGISTRATE.addDataGenerator(ProviderType.FLUID_TAGS, TagGen::genFluidTags);
Create.REGISTRATE.addDataGenerator(ProviderType.ENTITY_TAGS, TagGen::genEntityTags);
} }
private static void genBlockTags(RegistrateTagsProvider<Block> prov) { private static void genBlockTags(RegistrateTagsProvider<Block> prov) {
@ -226,6 +229,17 @@ public class TagGen {
} }
} }
private static void genEntityTags(RegistrateTagsProvider<EntityType<?>> prov) {
// VALIDATE
for (AllEntityTags tag : AllEntityTags.values()) {
if (tag.alwaysDatagen) {
prov.getOrCreateRawBuilder(tag.tag);
}
}
}
private static class StrippedWoodHelper { private static class StrippedWoodHelper {
protected final TagAppender<Item> logAppender; protected final TagAppender<Item> logAppender;
protected final TagAppender<Item> woodAppender; protected final TagAppender<Item> woodAppender;
@ -244,4 +258,5 @@ public class TagGen {
} }
} }
} }
} }

View file

@ -11,6 +11,7 @@ public class CLogistics extends ConfigBase {
public final ConfigInt displayLinkRange = i(64, 1, "displayLinkRange", Comments.displayLinkRange); public final ConfigInt displayLinkRange = i(64, 1, "displayLinkRange", Comments.displayLinkRange);
public final ConfigInt vaultCapacity = i(20, 1, "vaultCapacity", Comments.vaultCapacity); public final ConfigInt vaultCapacity = i(20, 1, "vaultCapacity", Comments.vaultCapacity);
public final ConfigInt brassTunnelTimer = i(10, 1, 10, "brassTunnelTimer", Comments.brassTunnelTimer); public final ConfigInt brassTunnelTimer = i(10, 1, 10, "brassTunnelTimer", Comments.brassTunnelTimer);
public final ConfigBool seatHostileMobs = b(true, "seatHostileMobs", Comments.seatHostileMobs);
@Override @Override
public String getName() { public String getName() {
@ -28,6 +29,7 @@ public class CLogistics extends ConfigBase {
static String mechanicalArmRange = "Maximum distance in blocks a Mechanical Arm can reach across."; static String mechanicalArmRange = "Maximum distance in blocks a Mechanical Arm can reach across.";
static String vaultCapacity = "The total amount of stacks a vault can hold per block in size."; static String vaultCapacity = "The total amount of stacks a vault can hold per block in size.";
static String brassTunnelTimer = "The amount of ticks a brass tunnel waits between distributions."; static String brassTunnelTimer = "The amount of ticks a brass tunnel waits between distributions.";
static String seatHostileMobs = "Whether hostile mobs walking near a seat will start riding it.";
} }
} }

View file

@ -57,8 +57,8 @@
} }
}, },
{ {
"from": [6.1, 2.5, 3.6], "from": [6, 2.5, 3.5],
"to": [9.9, 3.5, 7.4], "to": [10, 3.5, 7.5],
"faces": { "faces": {
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"}, "north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"}, "east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
@ -68,8 +68,8 @@
} }
}, },
{ {
"from": [6.1, 2.5, 8.6], "from": [6, 2.5, 8.5],
"to": [9.9, 3.5, 12.4], "to": [10, 3.5, 12.5],
"faces": { "faces": {
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"}, "north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"}, "east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},

View file

@ -57,8 +57,8 @@
} }
}, },
{ {
"from": [6.1, 2.5, 3.6], "from": [6, 2.5, 3.5],
"to": [9.9, 3.5, 7.4], "to": [10, 3.5, 7.5],
"faces": { "faces": {
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"}, "north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"}, "east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
@ -68,8 +68,8 @@
} }
}, },
{ {
"from": [6.1, 2.5, 8.6], "from": [6, 2.5, 8.5],
"to": [9.9, 3.5, 12.4], "to": [10, 3.5, 12.5],
"faces": { "faces": {
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"}, "north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"}, "east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},

View file

@ -48,8 +48,8 @@
} }
}, },
{ {
"from": [6.1, 2.5, 3.6], "from": [6, 2.5, 3.5],
"to": [9.9, 3.5, 7.4], "to": [10, 3.5, 7.5],
"faces": { "faces": {
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"}, "north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"}, "east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
@ -59,8 +59,8 @@
} }
}, },
{ {
"from": [6.1, 2.5, 8.6], "from": [6, 2.5, 8.5],
"to": [9.9, 3.5, 12.4], "to": [10, 3.5, 12.5],
"faces": { "faces": {
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"}, "north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"}, "east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},

View file

@ -48,8 +48,8 @@
} }
}, },
{ {
"from": [6.1, 2.5, 3.6], "from": [6, 2.5, 3.5],
"to": [9.9, 3.5, 7.4], "to": [10, 3.5, 7.5],
"faces": { "faces": {
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"}, "north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"}, "east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
@ -59,8 +59,8 @@
} }
}, },
{ {
"from": [6.1, 2.5, 8.6], "from": [6, 2.5, 8.5],
"to": [9.9, 3.5, 12.4], "to": [10, 3.5, 12.5],
"faces": { "faces": {
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"}, "north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"}, "east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},