Skip to content

Commit

Permalink
Updated to work with Forge 41.0.94+
Browse files Browse the repository at this point in the history
  • Loading branch information
GirafiStudios committed Jul 24, 2022
1 parent 66f93d6 commit bffb304
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
minecraft_version=1.19
forge_version=41.0.5
mod_version=2.6.0
forge_version=41.0.110
mod_version=2.6.1

org.gradle.jvmargs=-Xmx4G
org.gradle.daemon=false
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public class PassthroughSignsAPI {
*/
public static void setCanBePassed(String string) {
ResourceLocation resourceLocation = new ResourceLocation(string);
if (ForgeRegistries.ENTITIES.containsKey(resourceLocation)) {
ENTITY_PASSABLES.add(ForgeRegistries.ENTITIES.getValue(resourceLocation));
if (ForgeRegistries.ENTITY_TYPES.containsKey(resourceLocation)) {
ENTITY_PASSABLES.add(ForgeRegistries.ENTITY_TYPES.getValue(resourceLocation));
} else if (ForgeRegistries.BLOCKS.containsKey(resourceLocation)) {
BLOCK_PASSABLES.add(ForgeRegistries.BLOCKS.getValue(resourceLocation));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ public class PassableHandler {

@SubscribeEvent
public static void onPlayerInteract(PlayerInteractEvent.RightClickBlock event) {
Level level = event.getWorld();
Level level = event.getLevel();
BlockPos pos = event.getPos();
BlockState state = level.getBlockState(pos);
Player player = event.getPlayer();
Player player = event.getEntity();
Block block = state.getBlock();
if (block instanceof WallSignBlock && GENERAL.shouldWallSignBePassable.get() || block instanceof WallBannerBlock && GENERAL.shouldBannerBePassable.get() ||
block instanceof IPassable && ((IPassable) block).canBePassed(level, pos, IPassable.EnumPassableType.WALL_BLOCK) ||
Expand All @@ -57,9 +57,9 @@ public static void onPlayerInteract(PlayerInteractEvent.RightClickBlock event) {

@SubscribeEvent
public static void onEntityInteract(PlayerInteractEvent.EntityInteract event) {
Level level = event.getWorld();
Level level = event.getLevel();
BlockPos pos = event.getPos();
Player player = event.getPlayer();
Player player = event.getEntity();
Entity entity = event.getTarget();

if (entity instanceof ItemFrame && GENERAL.shouldItemFrameBePassable.get() || entity instanceof Painting && GENERAL.shouldPaintingsBePassable.get() ||
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ license="All rights reserved"
[[dependencies.passthroughsigns]]
modId="forge"
mandatory=true
versionRange="[41,)"
versionRange="[41.0.94,)"
ordering="AFTER"
side="BOTH"

0 comments on commit bffb304

Please sign in to comment.