mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 19:15:32 +00:00
1.18.x Omnibus (#8239)
This commit is contained in:
1 parent
4011c3fb07
commit
34291c1fb2
89 files changed
+1014
-1192
No files matched your search
@@ -60,14 +60,14 @@ public class CustomPlantTypeTest
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSustainPlant(BlockState state, BlockGetter world, BlockPos pos, Direction facing, IPlantable plantable)
|
||||
public boolean canSustainPlant(BlockState state, BlockGetter level, BlockPos pos, Direction facing, IPlantable plantable)
|
||||
{
|
||||
PlantType type = plantable.getPlantType(world, pos.relative(facing));
|
||||
PlantType type = plantable.getPlantType(level, pos.relative(facing));
|
||||
if (type != null && type == CustomPlantBlock.pt)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return super.canSustainPlant(state, world, pos, facing, plantable);
|
||||
return super.canSustainPlant(state, level, pos, facing, plantable);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,13 +82,13 @@ public class CustomPlantTypeTest
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlantType getPlantType(BlockGetter world, BlockPos pos)
|
||||
public PlantType getPlantType(BlockGetter level, BlockPos pos)
|
||||
{
|
||||
return pt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getPlant(BlockGetter world, BlockPos pos)
|
||||
public BlockState getPlant(BlockGetter level, BlockPos pos)
|
||||
{
|
||||
return defaultBlockState();
|
||||
}
|
||||
|
||||
@@ -73,9 +73,9 @@ public class CustomRespawnTest
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<Vec3> getRespawnPosition(BlockState state, EntityType<?> type, LevelReader world, BlockPos pos, float orientation, @Nullable LivingEntity entity)
|
||||
public Optional<Vec3> getRespawnPosition(BlockState state, EntityType<?> type, LevelReader levelReader, BlockPos pos, float orientation, @Nullable LivingEntity entity)
|
||||
{
|
||||
return RespawnAnchorBlock.findStandUpPosition(type, world, pos);
|
||||
return RespawnAnchorBlock.findStandUpPosition(type, levelReader, pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,12 +59,12 @@ public class RedstoneSidedConnectivityTest
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectRedstone(BlockState state, BlockGetter world, BlockPos pos, @Nullable Direction direction)
|
||||
public boolean canConnectRedstone(BlockState state, BlockGetter level, BlockPos pos, @Nullable Direction direction)
|
||||
{
|
||||
//The passed direction is relative to the redstone dust
|
||||
//This block connects on the east side relative to this block, which is west for the dust
|
||||
return direction == Direction.WEST &&
|
||||
world.getBlockEntity(pos.relative(Direction.UP)) instanceof FurnaceBlockEntity;
|
||||
level.getBlockEntity(pos.relative(Direction.UP)) instanceof FurnaceBlockEntity;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
|
||||
@@ -81,7 +81,7 @@ public class ScaffoldingTest
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isScaffolding(BlockState state, LevelReader world, BlockPos pos, LivingEntity entity)
|
||||
public boolean isScaffolding(BlockState state, LevelReader level, BlockPos pos, LivingEntity entity)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -36,9 +36,9 @@ public class SlipperinessTest
|
||||
e.getRegistry().register((new Block(Block.Properties.of(Material.ICE_SOLID))
|
||||
{
|
||||
@Override
|
||||
public float getFriction(BlockState state, LevelReader world, BlockPos pos, Entity entity)
|
||||
public float getFriction(BlockState state, LevelReader level, BlockPos pos, Entity entity)
|
||||
{
|
||||
return entity instanceof Boat ? 2 : super.getFriction(state, world, pos, entity);
|
||||
return entity instanceof Boat ? 2 : super.getFriction(state, level, pos, entity);
|
||||
}
|
||||
}).setRegistryName(MOD_ID, BLOCK_ID));
|
||||
}
|
||||
|
||||
@@ -318,13 +318,11 @@ public class CustomTooltipTest
|
||||
}
|
||||
|
||||
// legacy ToolTip methods
|
||||
@SuppressWarnings("removal")
|
||||
private void test13(Button button, PoseStack poseStack, int mouseX, int mouseY)
|
||||
{
|
||||
renderTooltip(poseStack, List.of(new TextComponent("test").getVisualOrderText()), mouseX, mouseY, this.testFont);
|
||||
}
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
private void test14(Button button, PoseStack poseStack, int mouseX, int mouseY)
|
||||
{
|
||||
renderComponentTooltip(poseStack, List.of(new TextComponent("test")), mouseX, mouseY, this.testFont, ItemStack.EMPTY);
|
||||
|
||||
@@ -72,9 +72,9 @@ public class ContainerTypeTest
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderBg(PoseStack mStack, float partialTicks, int mouseX, int mouseY)
|
||||
protected void renderBg(PoseStack poseStack, float partialTick, int mouseX, int mouseY)
|
||||
{
|
||||
drawString(mStack, this.font, getMenu().text, mouseX, mouseY, -1);
|
||||
drawString(poseStack, this.font, getMenu().text, mouseX, mouseY, -1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user