More fixes

This commit is contained in:
Adubbz 2020-07-05 02:08:15 +10:00
parent ecbeb67551
commit 907934184b
33 changed files with 220 additions and 1610 deletions

View File

@ -1,42 +0,0 @@
/*******************************************************************************
* Copyright 2014-2019, the Biomes O' Plenty Team
*
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
*
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
******************************************************************************/
package biomesoplenty.client.handler;
import biomesoplenty.core.BiomesOPlenty;
import biomesoplenty.init.ModBiomes;
import biomesoplenty.init.ModConfig;
import net.minecraft.client.gui.screen.CreateWorldScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.world.WorldType;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.GuiScreenEvent;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.FORGE)
public class GuiEventHandler
{
@SubscribeEvent
@OnlyIn(Dist.CLIENT)
public static void onPreInitCreateWorld(GuiScreenEvent.InitGuiEvent.Pre event)
{
Screen screenGui = event.getGui();
if (ModConfig.ClientConfig.useWorldType.get() && screenGui instanceof CreateWorldScreen)
{
CreateWorldScreen createWorldGui = (CreateWorldScreen)screenGui;
// Do not change back when returning from the 'Customize' screen
if (createWorldGui.levelTypeIndex == WorldType.NORMAL.getId())
createWorldGui.levelTypeIndex = ModBiomes.worldType.getId();
}
}
}

View File

@ -7,22 +7,9 @@
******************************************************************************/
package biomesoplenty.client.util;
import biomesoplenty.common.world.BOPLayerUtil;
import biomesoplenty.common.world.BOPOverworldGenSettings;
import biomesoplenty.common.world.layer.traits.IBOPContextExtended;
import biomesoplenty.common.world.layer.traits.LazyAreaLayerContextBOP;
import biomesoplenty.init.ModBiomes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.GameType;
import net.minecraft.world.WorldSettings;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biomes;
import net.minecraft.world.biome.provider.BiomeProviderType;
import net.minecraft.world.biome.provider.OverworldBiomeProviderSettings;
import net.minecraft.world.gen.OverworldGenSettings;
import net.minecraft.world.gen.area.IAreaFactory;
import net.minecraft.world.gen.area.LazyArea;
import net.minecraft.world.storage.WorldInfo;
import org.lwjgl.glfw.GLFW;
import org.lwjgl.glfw.GLFWVidMode;
import org.lwjgl.opengl.GL;
@ -30,7 +17,6 @@ import org.lwjgl.opengl.GL11;
import org.lwjgl.system.MemoryStack;
import java.nio.IntBuffer;
import java.util.function.LongFunction;
import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.opengl.GL13.GL_TEXTURE0;
@ -160,31 +146,32 @@ public class GenLayerVisualizer
private void populateBiomeIds()
{
OverworldBiomeProviderSettings settingsProvider = BiomeProviderType.VANILLA_LAYERED.createSettings(new WorldInfo(new WorldSettings(0, GameType.NOT_SET, true, false, ModBiomes.worldType), "MpServer"));
OverworldGenSettings settings = settingsProvider.getGeneratorSettings();
LongFunction<IBOPContextExtended<LazyArea>> contextFactory = (seedModifier) -> {
return new LazyAreaLayerContextBOP(1, 0, seedModifier);
};
IAreaFactory<LazyArea> landAreaFactory = BOPLayerUtil.createInitialLandAndSeaFactory(contextFactory);
IAreaFactory<LazyArea> climateFactory = BOPLayerUtil.createClimateFactory(contextFactory, new BOPOverworldGenSettings());
IAreaFactory<LazyArea> biomeAreaFactory = BOPLayerUtil.createBiomeFactory(landAreaFactory, climateFactory, contextFactory);
//IAreaFactory<LazyArea> biomeAreaFactory = BOPLayerUtil.createAreaFactories(WorldType.DEFAULT, settings, contextFactory).get(0);
LazyArea area = biomeAreaFactory.make();
int startX = 5000;
int startZ = 10000;
for (int i = 0; i < CANVAS_HEIGHT ; ++i)
{
for (int j = 0; j < CANVAS_WIDTH ; ++j)
{
this.biomeIds[j + i * CANVAS_WIDTH] = area.get(startX + j, startZ + i);
}
}
// FIXME
// OverworldBiomeProviderSettings settingsProvider = BiomeProviderType.VANILLA_LAYERED.createSettings(new WorldInfo(new WorldSettings(0, GameType.NOT_SET, true, false, ModBiomes.worldType), "MpServer"));
// OverworldGenSettings settings = settingsProvider.getGeneratorSettings();
//
// LongFunction<IBOPContextExtended<LazyArea>> contextFactory = (seedModifier) -> {
// return new LazyAreaLayerContextBOP(1, 0, seedModifier);
// };
//
// IAreaFactory<LazyArea> landAreaFactory = BOPLayerUtil.createInitialLandAndSeaFactory(contextFactory);
// IAreaFactory<LazyArea> climateFactory = BOPLayerUtil.createClimateFactory(contextFactory, new BOPOverworldGenSettings());
// IAreaFactory<LazyArea> biomeAreaFactory = BOPLayerUtil.createBiomeFactory(landAreaFactory, climateFactory, contextFactory);
//
// //IAreaFactory<LazyArea> biomeAreaFactory = BOPLayerUtil.createAreaFactories(WorldType.DEFAULT, settings, contextFactory).get(0);
//
// LazyArea area = biomeAreaFactory.make();
//
// int startX = 5000;
// int startZ = 10000;
//
// for (int i = 0; i < CANVAS_HEIGHT ; ++i)
// {
// for (int j = 0; j < CANVAS_WIDTH ; ++j)
// {
// this.biomeIds[j + i * CANVAS_WIDTH] = area.get(startX + j, startZ + i);
// }
// }
}
private int getColourForBiomeId(int biomeId, BlockPos pos)

View File

@ -67,8 +67,9 @@ public class DoubleWaterPlantBlock extends DoublePlantBlock implements IWaterLog
if (state.getValue(HALF) != DoubleBlockHalf.UPPER)
{
BlockPos posBelow = pos.below();
Block existingBlock = worldIn.getBlockState(pos).getBlock();
return (existingBlock == this || existingBlock.getMaterial(state) == Material.WATER) && this.isExposed(worldIn, pos.above()) && worldIn.getBlockState(posBelow).isFaceSturdy(worldIn, posBelow, Direction.UP);
BlockState existingState = worldIn.getBlockState(pos);
Block existingBlock = existingState.getBlock();
return (existingBlock == this || existingState.getMaterial() == Material.WATER) && this.isExposed(worldIn, pos.above()) && worldIn.getBlockState(posBelow).isFaceSturdy(worldIn, posBelow, Direction.UP);
}
else
{

View File

@ -25,15 +25,8 @@ public class DriedSaltBlock extends Block
public boolean canSustainPlant(BlockState state, IBlockReader world, BlockPos pos, Direction facing, net.minecraftforge.common.IPlantable plantable) {
PlantType type = plantable.getPlantType(world, pos.relative(facing));
switch (type) {
case PlantType.DESERT: return true;
case PlantType.NETHER: return false;
case PlantType.CROP: return false;
case PlantType.CAVE: return true;
case PlantType.PLAINS: return false;
case PlantType.WATER: return false;
case PlantType.BEACH: return false;
}
if (type == PlantType.DESERT) return true;
else if (type == PlantType.CAVE) return true;
return false;
}
}

View File

@ -35,20 +35,15 @@ public class MudBlock extends Block
{
PlantType type = plantable.getPlantType(world, pos.relative(facing));
switch (type) {
case PlantType.DESERT: return false;
case PlantType.NETHER: return false;
case PlantType.CROP: return false;
case PlantType.CAVE: return false;
case PlantType.PLAINS: return false;
case PlantType.WATER: return false;
case PlantType.BEACH:
boolean hasWater = (world.getBlockState(pos.east()).getMaterial() == Material.WATER ||
world.getBlockState(pos.west()).getMaterial() == Material.WATER ||
world.getBlockState(pos.north()).getMaterial() == Material.WATER ||
world.getBlockState(pos.south()).getMaterial() == Material.WATER);
return hasWater;
if (type == PlantType.BEACH)
{
boolean hasWater = (world.getBlockState(pos.east()).getMaterial() == Material.WATER ||
world.getBlockState(pos.west()).getMaterial() == Material.WATER ||
world.getBlockState(pos.north()).getMaterial() == Material.WATER ||
world.getBlockState(pos.south()).getMaterial() == Material.WATER);
return hasWater;
}
return false;
}
}

View File

@ -43,9 +43,9 @@ public class MushroomBlockBOP extends MushroomBlock implements IGrowable
}
@Override
public boolean growMushroom(ServerWorld p_226940_1_, BlockPos p_226940_2_, BlockState p_226940_3_, Random p_226940_4_)
public boolean growMushroom(ServerWorld world, BlockPos p_226940_2_, BlockState p_226940_3_, Random p_226940_4_)
{
p_226940_1_.removeBlock(p_226940_2_, false);
world.removeBlock(p_226940_2_, false);
ConfiguredFeature<NoFeatureConfig, ?> configuredfeature;
if (this == BOPBlocks.glowshroom)
{
@ -55,20 +55,20 @@ public class MushroomBlockBOP extends MushroomBlock implements IGrowable
{
if (this != BOPBlocks.toadstool)
{
p_226940_1_.setBlock(p_226940_2_, p_226940_3_, 3);
world.setBlock(p_226940_2_, p_226940_3_, 3);
return false;
}
configuredfeature = BOPBiomeFeatures.HUGE_TOADSTOOL.configured(IFeatureConfig.NONE);
}
if (configuredfeature.place(p_226940_1_, p_226940_1_.getChunkSource().getGenerator(), p_226940_4_, p_226940_2_))
if (configuredfeature.place(world, world.structureFeatureManager(), world.getChunkSource().getGenerator(), p_226940_4_, p_226940_2_))
{
return true;
}
else
{
p_226940_1_.setBlock(p_226940_2_, p_226940_3_, 3);
world.setBlock(p_226940_2_, p_226940_3_, 3);
return false;
}
}

View File

@ -21,20 +21,17 @@ public class WhiteSandBlock extends SandBlock
{
PlantType type = plantable.getPlantType(world, pos.relative(facing));
switch (type) {
case PlantType.DESERT: return true;
case PlantType.NETHER: return false;
case PlantType.CROP: return false;
case PlantType.CAVE: return true;
case PlantType.PLAINS: return false;
case PlantType.WATER: return false;
case PlantType.BEACH:
boolean hasWater = (world.getBlockState(pos.east()).getMaterial() == Material.WATER ||
world.getBlockState(pos.west()).getMaterial() == Material.WATER ||
world.getBlockState(pos.north()).getMaterial() == Material.WATER ||
world.getBlockState(pos.south()).getMaterial() == Material.WATER);
return hasWater;
if (type == PlantType.DESERT) return true;
else if (type == PlantType.CAVE) return true;
else if (type == PlantType.BEACH)
{
boolean hasWater = (world.getBlockState(pos.east()).getMaterial() == Material.WATER ||
world.getBlockState(pos.west()).getMaterial() == Material.WATER ||
world.getBlockState(pos.north()).getMaterial() == Material.WATER ||
world.getBlockState(pos.south()).getMaterial() == Material.WATER);
return hasWater;
}
return false;
}
}

View File

@ -15,6 +15,7 @@ import net.minecraft.world.IWorld;
import net.minecraft.world.biome.DefaultBiomeFeatures;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.feature.*;
import net.minecraft.world.server.ServerWorld;
import javax.annotation.Nullable;
import java.util.Random;
@ -23,14 +24,14 @@ public abstract class BigTreeDefaultConfig extends BigTree
{
@Override
@Nullable
protected ConfiguredFeature<TreeFeatureConfig, ?> getConfiguredFeature(Random random, boolean hasFlowers)
protected ConfiguredFeature<BaseTreeFeatureConfig, ?> getConfiguredFeature(Random random, boolean hasFlowers)
{
return null;
}
@Override
@Nullable
protected ConfiguredFeature<HugeTreeFeatureConfig, ?> getConfiguredMegaFeature(Random random)
protected ConfiguredFeature<BaseTreeFeatureConfig, ?> getConfiguredMegaFeature(Random random)
{
return null;
}
@ -39,7 +40,7 @@ public abstract class BigTreeDefaultConfig extends BigTree
protected abstract Feature<? extends BaseTreeFeatureConfig> getBigFeature(Random random);
@Override
public boolean growTree(IWorld world, ChunkGenerator<?> generator, BlockPos pos, BlockState state, Random random)
public boolean growTree(ServerWorld world, ChunkGenerator generator, BlockPos pos, BlockState state, Random random)
{
for (int i = 0; i >= -1; --i)
{
@ -61,7 +62,7 @@ public abstract class BigTreeDefaultConfig extends BigTree
else
{
world.setBlock(pos, Blocks.AIR.defaultBlockState(), 4);
if (feature.place(world, generator, random, pos, DefaultBiomeFeatures.NORMAL_TREE_CONFIG))
if (feature.place(world, world.structureFeatureManager(), generator, random, pos, DefaultBiomeFeatures.NORMAL_TREE_CONFIG))
{
return true;
}
@ -74,7 +75,7 @@ public abstract class BigTreeDefaultConfig extends BigTree
}
@Override
public boolean placeMega(IWorld world, ChunkGenerator<?> generator, BlockPos pos, BlockState state, Random random, int x, int z)
public boolean placeMega(ServerWorld world, ChunkGenerator generator, BlockPos pos, BlockState state, Random random, int x, int z)
{
Feature<BaseTreeFeatureConfig> feature = (Feature<BaseTreeFeatureConfig>)this.getBigFeature(random);
if (feature == null)
@ -88,7 +89,7 @@ public abstract class BigTreeDefaultConfig extends BigTree
world.setBlock(pos.offset(x + 1, 0, z), blockstate, 4);
world.setBlock(pos.offset(x, 0, z + 1), blockstate, 4);
world.setBlock(pos.offset(x + 1, 0, z + 1), blockstate, 4);
if (feature.place(world, generator, random, pos.offset(x, 0, z), DefaultBiomeFeatures.NORMAL_TREE_CONFIG))
if (feature.place(world, world.structureFeatureManager(), generator, random, pos.offset(x, 0, z), DefaultBiomeFeatures.NORMAL_TREE_CONFIG))
{
return true;
}

View File

@ -15,6 +15,7 @@ import net.minecraft.world.IWorld;
import net.minecraft.world.biome.DefaultBiomeFeatures;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.feature.*;
import net.minecraft.world.server.ServerWorld;
import javax.annotation.Nullable;
import java.util.Random;
@ -23,7 +24,7 @@ public abstract class TreeDefaultConfig extends Tree
{
@Override
@Nullable
protected ConfiguredFeature<TreeFeatureConfig, ?> getConfiguredFeature(Random random, boolean hasFlowers)
protected ConfiguredFeature<BaseTreeFeatureConfig, ?> getConfiguredFeature(Random random, boolean hasFlowers)
{
return null;
}
@ -31,7 +32,7 @@ public abstract class TreeDefaultConfig extends Tree
protected abstract Feature<? extends BaseTreeFeatureConfig> getFeature(Random random);
@Override
public boolean growTree(IWorld world, ChunkGenerator<?> generator, BlockPos pos, BlockState state, Random random)
public boolean growTree(ServerWorld world, ChunkGenerator generator, BlockPos pos, BlockState state, Random random)
{
Feature<BaseTreeFeatureConfig> feature = (Feature<BaseTreeFeatureConfig>)this.getFeature(random);
if (feature == null)
@ -41,7 +42,7 @@ public abstract class TreeDefaultConfig extends Tree
else
{
world.setBlock(pos, Blocks.AIR.defaultBlockState(), 4);
if (feature.place(world, generator, random, pos, DefaultBiomeFeatures.NORMAL_TREE_CONFIG))
if (feature.place(world, world.structureFeatureManager(), generator, random, pos, DefaultBiomeFeatures.NORMAL_TREE_CONFIG))
{
return true;
}

View File

@ -1,935 +0,0 @@
package biomesoplenty.common.entity.item;
import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.api.entity.BOPEntities;
import biomesoplenty.api.item.BOPItems;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.LilyPadBlock;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.MoverType;
import net.minecraft.entity.item.BoatEntity;
import net.minecraft.entity.passive.AnimalEntity;
import net.minecraft.entity.passive.WaterMobEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.fluid.IFluidState;
import net.minecraft.item.Item;
import net.minecraft.item.Items;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.network.IPacket;
import net.minecraft.network.datasync.DataParameter;
import net.minecraft.network.datasync.DataSerializers;
import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.network.play.client.CSteerBoatPacket;
import net.minecraft.network.play.server.SSpawnObjectPacket;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.tags.FluidTags;
import net.minecraft.util.*;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.shapes.IBooleanFunction;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes;
import net.minecraft.world.GameRules;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.network.FMLPlayMessages;
import net.minecraftforge.fml.network.NetworkHooks;
import javax.annotation.Nullable;
import java.util.List;
public class BoatEntityBOP extends BoatEntity {
private static final DataParameter<Integer> DATA_ID_HURT = EntityDataManager.defineId(BoatEntity.class, DataSerializers.INT);
private static final DataParameter<Integer> DATA_ID_HURTDIR = EntityDataManager.defineId(BoatEntity.class, DataSerializers.INT);
private static final DataParameter<Float> DATA_ID_DAMAGE = EntityDataManager.defineId(BoatEntity.class, DataSerializers.FLOAT);
private static final DataParameter<Integer> DATA_ID_TYPE = EntityDataManager.defineId(BoatEntity.class, DataSerializers.INT);
private static final DataParameter<Boolean> DATA_ID_PADDLE_LEFT = EntityDataManager.defineId(BoatEntity.class, DataSerializers.BOOLEAN);
private static final DataParameter<Boolean> DATA_ID_PADDLE_RIGHT = EntityDataManager.defineId(BoatEntity.class, DataSerializers.BOOLEAN);
private static final DataParameter<Integer> DATA_ID_BUBBLE_TIME = EntityDataManager.defineId(BoatEntity.class, DataSerializers.INT);
private final float[] paddlePositions = new float[2];
private float invFriction;
private float outOfControlTicks;
private float deltaRotation;
private int lerpSteps;
private double lerpX;
private double lerpY;
private double lerpZ;
private double lerpYRot;
private double lerpXRot;
private boolean inputLeft;
private boolean inputRight;
private boolean inputUp;
private boolean inputDown;
private double waterLevel;
private float landFriction;
private BoatEntity.Status status;
private BoatEntity.Status oldStatus;
private double lastYd;
private boolean isAboveBubbleColumn;
private boolean bubbleColumnDirectionIsDown;
private float bubbleMultiplier;
private float bubbleAngle;
private float bubbleAngleO;
public BoatEntityBOP(EntityType<? extends BoatEntity> p_i50129_1_, World p_i50129_2_) {
super(p_i50129_1_, p_i50129_2_);
this.blocksBuilding = true;
}
public BoatEntityBOP(World worldIn, double x, double y, double z) {
this(BOPEntities.boat_bop, worldIn);
this.setPos(x, y, z);
this.setDeltaMovement(Vec3d.ZERO);
this.xo = x;
this.yo = y;
this.zo = z;
}
public BoatEntityBOP(FMLPlayMessages.SpawnEntity spawnEntity, World world)
{
this(BOPEntities.boat_bop, world);
}
@Override
protected boolean isMovementNoisy() {
return false;
}
@Override
protected void defineSynchedData() {
this.entityData.define(DATA_ID_HURT, 0);
this.entityData.define(DATA_ID_HURTDIR, 1);
this.entityData.define(DATA_ID_DAMAGE, 0.0F);
this.entityData.define(DATA_ID_TYPE, BoatEntity.Type.OAK.ordinal());
this.entityData.define(DATA_ID_PADDLE_LEFT, false);
this.entityData.define(DATA_ID_PADDLE_RIGHT, false);
this.entityData.define(DATA_ID_BUBBLE_TIME, 0);
}
@Override
@Nullable
public AxisAlignedBB getCollideAgainstBox(Entity entityIn) {
return entityIn.isPushable() ? entityIn.getBoundingBox() : null;
}
@Override
@Nullable
public AxisAlignedBB getCollideBox() {
return this.getBoundingBox();
}
@Override
public boolean isPushable() {
return true;
}
@Override
public double getRideHeight() {
return -0.1D;
}
/**
* Called when the entity is attacked.
*/
@Override
public boolean hurt(DamageSource source, float amount) {
if (this.isInvulnerableTo(source)) {
return false;
} else if (!this.level.isClientSide && !this.removed) {
if (source instanceof IndirectEntityDamageSource && source.getEntity() != null && this.hasPassenger(source.getEntity())) {
return false;
} else {
this.setHurtDir(-this.getHurtDir());
this.setHurtTime(10);
this.setDamage(this.getDamage() + amount * 10.0F);
this.markHurt();
boolean flag = source.getEntity() instanceof PlayerEntity && ((PlayerEntity)source.getEntity()).abilities.instabuild;
if (flag || this.getDamage() > 40.0F) {
if (!flag && this.level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
this.spawnAtLocation(this.getDropItem());
}
this.remove();
}
return true;
}
} else {
return true;
}
}
@Override
public void onAboveBubbleCol(boolean downwards) {
if (!this.level.isClientSide) {
this.isAboveBubbleColumn = true;
this.bubbleColumnDirectionIsDown = downwards;
if (this.getBubbleTime() == 0) {
this.setBubbleTime(60);
}
}
this.level.addParticle(ParticleTypes.SPLASH, this.getX() + (double)this.random.nextFloat(), this.getY() + 0.7D, this.getZ() + (double)this.random.nextFloat(), 0.0D, 0.0D, 0.0D);
if (this.random.nextInt(20) == 0) {
this.level.playLocalSound(this.getX(), this.getY(), this.getZ(), this.getSwimSplashSound(), this.getSoundSource(), 1.0F, 0.8F + 0.4F * this.random.nextFloat(), false);
}
}
@Override
public Item getDropItem() {
switch (this.getBoatModel()) {
case FIR:
default:
return BOPItems.fir_boat;
case REDWOOD:
return BOPItems.redwood_boat;
case CHERRY:
return BOPItems.cherry_boat;
case MAHOGANY:
return BOPItems.mahogany_boat;
case JACARANDA:
return BOPItems.jacaranda_boat;
case PALM:
return BOPItems.palm_boat;
case WILLOW:
return BOPItems.willow_boat;
case DEAD:
return BOPItems.dead_boat;
case MAGIC:
return BOPItems.magic_boat;
case UMBRAN:
return BOPItems.umbran_boat;
case HELLBARK:
return BOPItems.hellbark_boat;
}
}
/**
* Setups the entity to do the hurt animation. Only used by packets in multiplayer.
*/
@Override
@OnlyIn(Dist.CLIENT)
public void animateHurt() {
this.setHurtDir(-this.getHurtDir());
this.setHurtTime(10);
this.setDamage(this.getDamage() * 11.0F);
}
/**
* Returns true if other Entities should be prevented from moving through this Entity.
*/
@Override
public boolean isPickable() {
return !this.removed;
}
/**
* Sets a target for the client to interpolate towards over the next few ticks
*/
@Override
@OnlyIn(Dist.CLIENT)
public void lerpTo(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean teleport) {
this.lerpX = x;
this.lerpY = y;
this.lerpZ = z;
this.lerpYRot = (double)yaw;
this.lerpXRot = (double)pitch;
this.lerpSteps = 10;
}
/**
* Gets the horizontal facing direction of this Entity, adjusted to take specially-treated entity types into account.
*/
@Override
public Direction getMotionDirection() {
return this.getDirection().getClockWise();
}
/**
* Called to update the entity's position/logic.
*/
@Override
public void tick() {
this.oldStatus = this.status;
this.status = this.getStatus();
if (this.status != BoatEntity.Status.UNDER_WATER && this.status != BoatEntity.Status.UNDER_FLOWING_WATER) {
this.outOfControlTicks = 0.0F;
} else {
++this.outOfControlTicks;
}
if (!this.level.isClientSide && this.outOfControlTicks >= 60.0F) {
this.ejectPassengers();
}
if (this.getHurtTime() > 0) {
this.setHurtTime(this.getHurtTime() - 1);
}
if (this.getDamage() > 0.0F) {
this.setDamage(this.getDamage() - 1.0F);
}
// SUPER
if (!this.level.isClientSide) {
this.setSharedFlag(6, this.isGlowing());
}
this.baseTick();
// END SUPER
this.tickLerp();
if (this.isControlledByLocalInstance()) {
if (this.getPassengers().isEmpty() || !(this.getPassengers().get(0) instanceof PlayerEntity)) {
this.setPaddleState(false, false);
}
this.floatBoat();
if (this.level.isClientSide) {
this.controlBoat();
this.level.sendPacketToServer(new CSteerBoatPacket(this.getPaddleState(0), this.getPaddleState(1)));
}
this.move(MoverType.SELF, this.getDeltaMovement());
} else {
this.setDeltaMovement(Vec3d.ZERO);
}
this.tickBubbleColumn();
for(int i = 0; i <= 1; ++i) {
if (this.getPaddleState(i)) {
if (!this.isSilent() && (double)(this.paddlePositions[i] % ((float)Math.PI * 2F)) <= (double)((float)Math.PI / 4F) && ((double)this.paddlePositions[i] + (double)((float)Math.PI / 8F)) % (double)((float)Math.PI * 2F) >= (double)((float)Math.PI / 4F)) {
SoundEvent soundevent = this.getPaddleSound();
if (soundevent != null) {
Vec3d vec3d = this.getViewVector(1.0F);
double d0 = i == 1 ? -vec3d.z : vec3d.z;
double d1 = i == 1 ? vec3d.x : -vec3d.x;
this.level.playSound((PlayerEntity)null, this.getX() + d0, this.getY(), this.getZ() + d1, soundevent, this.getSoundSource(), 1.0F, 0.8F + 0.4F * this.random.nextFloat());
}
}
this.paddlePositions[i] = (float)((double)this.paddlePositions[i] + (double)((float)Math.PI / 8F));
} else {
this.paddlePositions[i] = 0.0F;
}
}
this.checkInsideBlocks();
List<Entity> list = this.level.getEntities(this, this.getBoundingBox().inflate((double)0.2F, (double)-0.01F, (double)0.2F), EntityPredicates.pushableBy(this));
if (!list.isEmpty()) {
boolean flag = !this.level.isClientSide && !(this.getControllingPassenger() instanceof PlayerEntity);
for(int j = 0; j < list.size(); ++j) {
Entity entity = list.get(j);
if (!entity.hasPassenger(this)) {
if (flag && this.getPassengers().size() < 2 && !entity.isPassenger() && entity.getBbWidth() < this.getBbWidth() && entity instanceof LivingEntity && !(entity instanceof WaterMobEntity) && !(entity instanceof PlayerEntity)) {
entity.startRiding(this);
} else {
this.push(entity);
}
}
}
}
}
private void tickBubbleColumn() {
if (this.level.isClientSide) {
int i = this.getBubbleTime();
if (i > 0) {
this.bubbleMultiplier += 0.05F;
} else {
this.bubbleMultiplier -= 0.1F;
}
this.bubbleMultiplier = MathHelper.clamp(this.bubbleMultiplier, 0.0F, 1.0F);
this.bubbleAngleO = this.bubbleAngle;
this.bubbleAngle = 10.0F * (float)Math.sin((double)(0.5F * (float)this.level.getGameTime())) * this.bubbleMultiplier;
} else {
if (!this.isAboveBubbleColumn) {
this.setBubbleTime(0);
}
int k = this.getBubbleTime();
if (k > 0) {
--k;
this.setBubbleTime(k);
int j = 60 - k - 1;
if (j > 0 && k == 0) {
this.setBubbleTime(0);
Vec3d vec3d = this.getDeltaMovement();
if (this.bubbleColumnDirectionIsDown) {
this.setDeltaMovement(vec3d.add(0.0D, -0.7D, 0.0D));
this.ejectPassengers();
} else {
this.setDeltaMovement(vec3d.x, this.hasPassenger(PlayerEntity.class) ? 2.7D : 0.6D, vec3d.z);
}
}
this.isAboveBubbleColumn = false;
}
}
}
@Override
@Nullable
protected SoundEvent getPaddleSound() {
switch(this.getStatus()) {
case IN_WATER:
case UNDER_WATER:
case UNDER_FLOWING_WATER:
return SoundEvents.BOAT_PADDLE_WATER;
case ON_LAND:
return SoundEvents.BOAT_PADDLE_LAND;
case IN_AIR:
default:
return null;
}
}
@Override
protected void tickLerp() {
if (this.isControlledByLocalInstance()) {
this.lerpSteps = 0;
this.setPacketCoordinates(this.getX(), this.getY(), this.getZ());
}
if (this.lerpSteps > 0) {
double d0 = this.getX() + (this.lerpX - this.getX()) / (double)this.lerpSteps;
double d1 = this.getY() + (this.lerpY - this.getY()) / (double)this.lerpSteps;
double d2 = this.getZ() + (this.lerpZ - this.getZ()) / (double)this.lerpSteps;
double d3 = MathHelper.wrapDegrees(this.lerpYRot - (double)this.yRot);
this.yRot = (float)((double)this.yRot + d3 / (double)this.lerpSteps);
this.xRot = (float)((double)this.xRot + (this.lerpXRot - (double)this.xRot) / (double)this.lerpSteps);
--this.lerpSteps;
this.setPos(d0, d1, d2);
this.setRot(this.yRot, this.xRot);
}
}
@Override
public void setPaddleState(boolean left, boolean right) {
this.entityData.set(DATA_ID_PADDLE_LEFT, left);
this.entityData.set(DATA_ID_PADDLE_RIGHT, right);
}
@Override
@OnlyIn(Dist.CLIENT)
public float getRowingTime(int side, float limbSwing) {
return this.getPaddleState(side) ? (float)MathHelper.clampedLerp((double)this.paddlePositions[side] - (double)((float)Math.PI / 8F), (double)this.paddlePositions[side], (double)limbSwing) : 0.0F;
}
/**
* Determines whether the boat is in water, gliding on land, or in air
*/
private BoatEntity.Status getStatus() {
BoatEntity.Status boatentity$status = this.isUnderwater();
if (boatentity$status != null) {
this.waterLevel = this.getBoundingBox().maxY;
return boatentity$status;
} else if (this.checkInWater()) {
return BoatEntity.Status.IN_WATER;
} else {
float f = this.getGroundFriction();
if (f > 0.0F) {
this.landFriction = f;
return BoatEntity.Status.ON_LAND;
} else {
return BoatEntity.Status.IN_AIR;
}
}
}
@Override
public float getWaterLevelAbove() {
AxisAlignedBB axisalignedbb = this.getBoundingBox();
int i = MathHelper.floor(axisalignedbb.minX);
int j = MathHelper.ceil(axisalignedbb.maxX);
int k = MathHelper.floor(axisalignedbb.maxY);
int l = MathHelper.ceil(axisalignedbb.maxY - this.lastYd);
int i1 = MathHelper.floor(axisalignedbb.minZ);
int j1 = MathHelper.ceil(axisalignedbb.maxZ);
try (BlockPos.PooledMutable blockpos$pooledmutable = BlockPos.PooledMutable.acquire()) {
label161:
for(int k1 = k; k1 < l; ++k1) {
float f = 0.0F;
for(int l1 = i; l1 < j; ++l1) {
for(int i2 = i1; i2 < j1; ++i2) {
blockpos$pooledmutable.set(l1, k1, i2);
IFluidState ifluidstate = this.level.getFluidState(blockpos$pooledmutable);
if (ifluidstate.is(FluidTags.WATER)) {
f = Math.max(f, ifluidstate.getHeight(this.level, blockpos$pooledmutable));
}
if (f >= 1.0F) {
continue label161;
}
}
}
if (f < 1.0F) {
float f2 = (float)blockpos$pooledmutable.getY() + f;
return f2;
}
}
float f1 = (float)(l + 1);
return f1;
}
}
/**
* Decides how much the boat should be gliding on the land (based on any slippery blocks)
*/
@Override
public float getGroundFriction() {
AxisAlignedBB axisalignedbb = this.getBoundingBox();
AxisAlignedBB axisalignedbb1 = new AxisAlignedBB(axisalignedbb.minX, axisalignedbb.minY - 0.001D, axisalignedbb.minZ, axisalignedbb.maxX, axisalignedbb.minY, axisalignedbb.maxZ);
int i = MathHelper.floor(axisalignedbb1.minX) - 1;
int j = MathHelper.ceil(axisalignedbb1.maxX) + 1;
int k = MathHelper.floor(axisalignedbb1.minY) - 1;
int l = MathHelper.ceil(axisalignedbb1.maxY) + 1;
int i1 = MathHelper.floor(axisalignedbb1.minZ) - 1;
int j1 = MathHelper.ceil(axisalignedbb1.maxZ) + 1;
VoxelShape voxelshape = VoxelShapes.create(axisalignedbb1);
float f = 0.0F;
int k1 = 0;
try (BlockPos.PooledMutable blockpos$pooledmutable = BlockPos.PooledMutable.acquire()) {
for(int l1 = i; l1 < j; ++l1) {
for(int i2 = i1; i2 < j1; ++i2) {
int j2 = (l1 != i && l1 != j - 1 ? 0 : 1) + (i2 != i1 && i2 != j1 - 1 ? 0 : 1);
if (j2 != 2) {
for(int k2 = k; k2 < l; ++k2) {
if (j2 <= 0 || k2 != k && k2 != l - 1) {
blockpos$pooledmutable.set(l1, k2, i2);
BlockState blockstate = this.level.getBlockState(blockpos$pooledmutable);
if (!(blockstate.getBlock() instanceof LilyPadBlock) && VoxelShapes.joinIsNotEmpty(blockstate.getCollisionShape(this.level, blockpos$pooledmutable).move((double)l1, (double)k2, (double)i2), voxelshape, IBooleanFunction.AND)) {
f += blockstate.getSlipperiness(this.level, blockpos$pooledmutable, this);
++k1;
}
}
}
}
}
}
}
return f / (float)k1;
}
private boolean checkInWater() {
AxisAlignedBB axisalignedbb = this.getBoundingBox();
int i = MathHelper.floor(axisalignedbb.minX);
int j = MathHelper.ceil(axisalignedbb.maxX);
int k = MathHelper.floor(axisalignedbb.minY);
int l = MathHelper.ceil(axisalignedbb.minY + 0.001D);
int i1 = MathHelper.floor(axisalignedbb.minZ);
int j1 = MathHelper.ceil(axisalignedbb.maxZ);
boolean flag = false;
this.waterLevel = Double.MIN_VALUE;
try (BlockPos.PooledMutable blockpos$pooledmutable = BlockPos.PooledMutable.acquire()) {
for(int k1 = i; k1 < j; ++k1) {
for(int l1 = k; l1 < l; ++l1) {
for(int i2 = i1; i2 < j1; ++i2) {
blockpos$pooledmutable.set(k1, l1, i2);
IFluidState ifluidstate = this.level.getFluidState(blockpos$pooledmutable);
if (ifluidstate.is(FluidTags.WATER)) {
float f = (float)l1 + ifluidstate.getHeight(this.level, blockpos$pooledmutable);
this.waterLevel = Math.max((double)f, this.waterLevel);
flag |= axisalignedbb.minY < (double)f;
}
}
}
}
}
return flag;
}
/**
* Decides whether the boat is currently underwater.
*/
@Nullable
private BoatEntity.Status isUnderwater() {
AxisAlignedBB axisalignedbb = this.getBoundingBox();
double d0 = axisalignedbb.maxY + 0.001D;
int i = MathHelper.floor(axisalignedbb.minX);
int j = MathHelper.ceil(axisalignedbb.maxX);
int k = MathHelper.floor(axisalignedbb.maxY);
int l = MathHelper.ceil(d0);
int i1 = MathHelper.floor(axisalignedbb.minZ);
int j1 = MathHelper.ceil(axisalignedbb.maxZ);
boolean flag = false;
try (BlockPos.PooledMutable blockpos$pooledmutable = BlockPos.PooledMutable.acquire()) {
for(int k1 = i; k1 < j; ++k1) {
for(int l1 = k; l1 < l; ++l1) {
for(int i2 = i1; i2 < j1; ++i2) {
blockpos$pooledmutable.set(k1, l1, i2);
IFluidState ifluidstate = this.level.getFluidState(blockpos$pooledmutable);
if (ifluidstate.is(FluidTags.WATER) && d0 < (double)((float)blockpos$pooledmutable.getY() + ifluidstate.getHeight(this.level, blockpos$pooledmutable))) {
if (!ifluidstate.isSource()) {
BoatEntity.Status boatentity$status = BoatEntity.Status.UNDER_FLOWING_WATER;
return boatentity$status;
}
flag = true;
}
}
}
}
}
return flag ? BoatEntity.Status.UNDER_WATER : null;
}
/**
* Update the boat's speed, based on momentum.
*/
private void floatBoat() {
double d0 = (double)-0.04F;
double d1 = this.isNoGravity() ? 0.0D : (double)-0.04F;
double d2 = 0.0D;
this.invFriction = 0.05F;
if (this.oldStatus == BoatEntity.Status.IN_AIR && this.status != BoatEntity.Status.IN_AIR && this.status != BoatEntity.Status.ON_LAND) {
this.waterLevel = this.getY(1.0D);
this.setPos(this.getX(), (double)(this.getWaterLevelAbove() - this.getBbHeight()) + 0.101D, this.getZ());
this.setDeltaMovement(this.getDeltaMovement().multiply(1.0D, 0.0D, 1.0D));
this.lastYd = 0.0D;
this.status = BoatEntity.Status.IN_WATER;
} else {
if (this.status == BoatEntity.Status.IN_WATER) {
d2 = (this.waterLevel - this.getY()) / (double)this.getBbHeight();
this.invFriction = 0.9F;
} else if (this.status == BoatEntity.Status.UNDER_FLOWING_WATER) {
d1 = -7.0E-4D;
this.invFriction = 0.9F;
} else if (this.status == BoatEntity.Status.UNDER_WATER) {
d2 = (double)0.01F;
this.invFriction = 0.45F;
} else if (this.status == BoatEntity.Status.IN_AIR) {
this.invFriction = 0.9F;
} else if (this.status == BoatEntity.Status.ON_LAND) {
this.invFriction = this.landFriction;
if (this.getControllingPassenger() instanceof PlayerEntity) {
this.landFriction /= 2.0F;
}
}
Vec3d vec3d = this.getDeltaMovement();
this.setDeltaMovement(vec3d.x * (double)this.invFriction, vec3d.y + d1, vec3d.z * (double)this.invFriction);
this.deltaRotation *= this.invFriction;
if (d2 > 0.0D) {
Vec3d vec3d1 = this.getDeltaMovement();
this.setDeltaMovement(vec3d1.x, (vec3d1.y + d2 * 0.06153846016296973D) * 0.75D, vec3d1.z);
}
}
}
private void controlBoat() {
if (this.isVehicle()) {
float f = 0.0F;
if (this.inputLeft) {
--this.deltaRotation;
}
if (this.inputRight) {
++this.deltaRotation;
}
if (this.inputRight != this.inputLeft && !this.inputUp && !this.inputDown) {
f += 0.005F;
}
this.yRot += this.deltaRotation;
if (this.inputUp) {
f += 0.04F;
}
if (this.inputDown) {
f -= 0.005F;
}
this.setDeltaMovement(this.getDeltaMovement().add((double)(MathHelper.sin(-this.yRot * ((float)Math.PI / 180F)) * f), 0.0D, (double)(MathHelper.cos(this.yRot * ((float)Math.PI / 180F)) * f)));
this.setPaddleState(this.inputRight && !this.inputLeft || this.inputUp, this.inputLeft && !this.inputRight || this.inputUp);
}
}
@Override
public void positionRider(Entity passenger) {
if (this.hasPassenger(passenger)) {
float f = 0.0F;
float f1 = (float)((this.removed ? (double)0.01F : this.getRideHeight()) + passenger.getRidingHeight());
if (this.getPassengers().size() > 1) {
int i = this.getPassengers().indexOf(passenger);
if (i == 0) {
f = 0.2F;
} else {
f = -0.6F;
}
if (passenger instanceof AnimalEntity) {
f = (float)((double)f + 0.2D);
}
}
Vec3d vec3d = (new Vec3d((double)f, 0.0D, 0.0D)).yRot(-this.yRot * ((float)Math.PI / 180F) - ((float)Math.PI / 2F));
passenger.setPos(this.getX() + vec3d.x, this.getY() + (double)f1, this.getZ() + vec3d.z);
passenger.yRot += this.deltaRotation;
passenger.setYHeadRot(passenger.getYHeadRot() + this.deltaRotation);
this.clampRotation(passenger);
if (passenger instanceof AnimalEntity && this.getPassengers().size() > 1) {
int j = passenger.getId() % 2 == 0 ? 90 : 270;
passenger.setYBodyRot(((AnimalEntity)passenger).yBodyRot + (float)j);
passenger.setYHeadRot(passenger.getYHeadRot() + (float)j);
}
}
}
/**
* Applies this boat's yaw to the given entity. Used to update the orientation of its passenger.
*/
@Override
protected void clampRotation(Entity entityToUpdate) {
entityToUpdate.setYBodyRot(this.yRot);
float f = MathHelper.wrapDegrees(entityToUpdate.yRot - this.yRot);
float f1 = MathHelper.clamp(f, -105.0F, 105.0F);
entityToUpdate.yRotO += f1 - f;
entityToUpdate.yRot += f1 - f;
entityToUpdate.setYHeadRot(entityToUpdate.yRot);
}
/**
* Applies this entity's orientation (pitch/yaw) to another entity. Used to update passenger orientation.
*/
@Override
@OnlyIn(Dist.CLIENT)
public void onPassengerTurned(Entity entityToUpdate) {
this.clampRotation(entityToUpdate);
}
@Override
protected void addAdditionalSaveData(CompoundNBT compound) {
compound.putString("Type", this.getBoatModel().getName());
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
@Override
protected void readAdditionalSaveData(CompoundNBT compound) {
if (compound.contains("Type", 8)) {
this.setBoatModel(BoatEntityBOP.Type.byName(compound.getString("Type")));
}
}
@Override
public boolean interact(PlayerEntity player, Hand hand) {
if (player.isSecondaryUseActive()) {
return false;
} else {
return !this.level.isClientSide && this.outOfControlTicks < 60.0F ? player.startRiding(this) : false;
}
}
@Override
protected void checkFallDamage(double y, boolean onGroundIn, BlockState state, BlockPos pos) {
this.lastYd = this.getDeltaMovement().y;
if (!this.isPassenger()) {
if (onGroundIn) {
if (this.fallDistance > 3.0F) {
if (this.status != BoatEntity.Status.ON_LAND) {
this.fallDistance = 0.0F;
return;
}
this.causeFallDamage(this.fallDistance, 1.0F);
if (!this.level.isClientSide && !this.removed) {
this.remove();
if (this.level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
for(int i = 0; i < 3; ++i) {
this.spawnAtLocation(this.getBoatModel().getPlanks());
}
for(int j = 0; j < 2; ++j) {
this.spawnAtLocation(Items.STICK);
}
}
}
}
this.fallDistance = 0.0F;
} else if (!this.level.getFluidState((new BlockPos(this)).below()).is(FluidTags.WATER) && y < 0.0D) {
this.fallDistance = (float)((double)this.fallDistance - y);
}
}
}
@Override
public boolean getPaddleState(int side) {
return this.entityData.<Boolean>get(side == 0 ? DATA_ID_PADDLE_LEFT : DATA_ID_PADDLE_RIGHT) && this.getControllingPassenger() != null;
}
@Override
public void setDamage(float damageTaken) {
this.entityData.set(DATA_ID_DAMAGE, damageTaken);
}
@Override
public float getDamage() {
return this.entityData.get(DATA_ID_DAMAGE);
}
@Override
public void setHurtTime(int timeSinceHit) {
this.entityData.set(DATA_ID_HURT, timeSinceHit);
}
@Override
public int getHurtTime() {
return this.entityData.get(DATA_ID_HURT);
}
private void setBubbleTime(int p_203055_1_) {
this.entityData.set(DATA_ID_BUBBLE_TIME, p_203055_1_);
}
private int getBubbleTime() {
return this.entityData.get(DATA_ID_BUBBLE_TIME);
}
@Override
@OnlyIn(Dist.CLIENT)
public float getBubbleAngle(float partialTicks) {
return MathHelper.lerp(partialTicks, this.bubbleAngleO, this.bubbleAngle);
}
@Override
public void setHurtDir(int forwardDirection) {
this.entityData.set(DATA_ID_HURTDIR, forwardDirection);
}
@Override
public int getHurtDir() {
return this.entityData.get(DATA_ID_HURTDIR);
}
public void setBoatModel(BoatEntityBOP.Type boatType) {
this.entityData.set(DATA_ID_TYPE, boatType.ordinal());
}
public BoatEntityBOP.Type getBoatModel() {
return BoatEntityBOP.Type.byId(this.entityData.get(DATA_ID_TYPE));
}
@Override
protected boolean canAddPassenger(Entity passenger) {
return this.getPassengers().size() < 2 && !this.isUnderLiquid(FluidTags.WATER);
}
@Override
@Nullable
public Entity getControllingPassenger() {
List<Entity> list = this.getPassengers();
return list.isEmpty() ? null : list.get(0);
}
@Override
@OnlyIn(Dist.CLIENT)
public void setInput(boolean p_184442_1_, boolean p_184442_2_, boolean p_184442_3_, boolean p_184442_4_) {
this.inputLeft = p_184442_1_;
this.inputRight = p_184442_2_;
this.inputUp = p_184442_3_;
this.inputDown = p_184442_4_;
}
// Forge: Fix MC-119811 by instantly completing lerp on board
@Override
protected void addPassenger(Entity passenger) {
super.addPassenger(passenger);
if (this.isControlledByLocalInstance() && this.lerpSteps > 0) {
this.lerpSteps = 0;
this.absMoveTo(this.lerpX, this.lerpY, this.lerpZ, (float)this.lerpYRot, (float)this.lerpXRot);
}
}
@Override
public IPacket<?> getAddEntityPacket() {
return NetworkHooks.getEntitySpawningPacket(this);
}
public enum Type {
FIR(BOPBlocks.fir_planks, "fir"),
REDWOOD(BOPBlocks.redwood_planks, "redwood"),
CHERRY(BOPBlocks.cherry_planks, "cherry"),
MAHOGANY(BOPBlocks.mahogany_planks, "mahogany"),
JACARANDA(BOPBlocks.jacaranda_planks, "jacaranda"),
PALM(BOPBlocks.palm_planks, "palm"),
WILLOW(BOPBlocks.willow_planks, "willow"),
DEAD(BOPBlocks.dead_planks, "dead"),
MAGIC(BOPBlocks.magic_planks, "magic"),
UMBRAN(BOPBlocks.umbran_planks, "umbran"),
HELLBARK(BOPBlocks.hellbark_planks, "hellbark");
private final String name;
private final Block block;
private Type(Block p_i48146_3_, String p_i48146_4_) {
this.name = p_i48146_4_;
this.block = p_i48146_3_;
}
public String getName() {
return this.name;
}
public Block getPlanks() {
return this.block;
}
public String toString() {
return this.name;
}
/**
* Get a boat type by it's enum ordinal
*
* @return
*/
public static Type byId(int id) {
Type[] aboatentity$type = values();
if (id < 0 || id >= aboatentity$type.length) {
id = 0;
}
return aboatentity$type[id];
}
public static Type byName(String nameIn) {
Type[] aboatentity$type = values();
for (int i = 0; i < aboatentity$type.length; ++i) {
if (aboatentity$type[i].getName().equals(nameIn)) {
return aboatentity$type[i];
}
}
return aboatentity$type[0];
}
}
}

View File

@ -1,102 +0,0 @@
package biomesoplenty.common.entity.item;
import com.google.common.collect.ImmutableList;
import net.minecraft.client.renderer.entity.model.SegmentedModel;
import net.minecraft.client.renderer.model.ModelRenderer;
import net.minecraft.entity.item.BoatEntity;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import java.util.Arrays;
// Much care has been put into copying and pasting this, as you can tell
@OnlyIn(Dist.CLIENT)
public class BoatModelBOP extends SegmentedModel<BoatEntityBOP>
{
private final ModelRenderer[] paddles = new ModelRenderer[2];
private final ModelRenderer waterPatch;
private final ImmutableList<ModelRenderer> parts;
public BoatModelBOP()
{
ModelRenderer[] amodelrenderer = new ModelRenderer[]{(new ModelRenderer(this, 0, 0)).setTexSize(128, 64), (new ModelRenderer(this, 0, 19)).setTexSize(128, 64), (new ModelRenderer(this, 0, 27)).setTexSize(128, 64), (new ModelRenderer(this, 0, 35)).setTexSize(128, 64), (new ModelRenderer(this, 0, 43)).setTexSize(128, 64)};
int i = 32;
int j = 6;
int k = 20;
int l = 4;
int i1 = 28;
amodelrenderer[0].addBox(-14.0F, -9.0F, -3.0F, 28.0F, 16.0F, 3.0F, 0.0F);
amodelrenderer[0].setPos(0.0F, 3.0F, 1.0F);
amodelrenderer[1].addBox(-13.0F, -7.0F, -1.0F, 18.0F, 6.0F, 2.0F, 0.0F);
amodelrenderer[1].setPos(-15.0F, 4.0F, 4.0F);
amodelrenderer[2].addBox(-8.0F, -7.0F, -1.0F, 16.0F, 6.0F, 2.0F, 0.0F);
amodelrenderer[2].setPos(15.0F, 4.0F, 0.0F);
amodelrenderer[3].addBox(-14.0F, -7.0F, -1.0F, 28.0F, 6.0F, 2.0F, 0.0F);
amodelrenderer[3].setPos(0.0F, 4.0F, -9.0F);
amodelrenderer[4].addBox(-14.0F, -7.0F, -1.0F, 28.0F, 6.0F, 2.0F, 0.0F);
amodelrenderer[4].setPos(0.0F, 4.0F, 9.0F);
amodelrenderer[0].xRot = ((float) Math.PI / 2F);
amodelrenderer[1].yRot = ((float) Math.PI * 1.5F);
amodelrenderer[2].yRot = ((float) Math.PI / 2F);
amodelrenderer[3].yRot = (float) Math.PI;
this.paddles[0] = this.makePaddle(true);
this.paddles[0].setPos(3.0F, -5.0F, 9.0F);
this.paddles[1] = this.makePaddle(false);
this.paddles[1].setPos(3.0F, -5.0F, -9.0F);
this.paddles[1].yRot = (float) Math.PI;
this.paddles[0].zRot = 0.19634955F;
this.paddles[1].zRot = 0.19634955F;
this.waterPatch = (new ModelRenderer(this, 0, 0)).setTexSize(128, 64);
this.waterPatch.addBox(-14.0F, -9.0F, -3.0F, 28.0F, 16.0F, 3.0F, 0.0F);
this.waterPatch.setPos(0.0F, -3.0F, 1.0F);
this.waterPatch.xRot = ((float) Math.PI / 2F);
ImmutableList.Builder<ModelRenderer> builder = ImmutableList.builder();
builder.addAll(Arrays.asList(amodelrenderer));
builder.addAll(Arrays.asList(this.paddles));
this.parts = builder.build();
}
@Override
public void setupAnim(BoatEntityBOP p_225597_1_, float p_225597_2_, float p_225597_3_, float p_225597_4_, float p_225597_5_, float p_225597_6_)
{
this.animatePaddle(p_225597_1_, 0, p_225597_2_);
this.animatePaddle(p_225597_1_, 1, p_225597_2_);
}
@Override
public ImmutableList<ModelRenderer> parts()
{
return this.parts;
}
public ModelRenderer waterPatch()
{
return this.waterPatch;
}
protected ModelRenderer makePaddle(boolean p_187056_1_)
{
ModelRenderer modelrenderer = (new ModelRenderer(this, 62, p_187056_1_ ? 0 : 20)).setTexSize(128, 64);
int i = 20;
int j = 7;
int k = 6;
float f = -5.0F;
modelrenderer.addBox(-1.0F, 0.0F, -5.0F, 2.0F, 2.0F, 18.0F);
modelrenderer.addBox(p_187056_1_ ? -1.001F : 0.001F, -3.0F, 8.0F, 1.0F, 6.0F, 7.0F);
return modelrenderer;
}
protected void animatePaddle(BoatEntityBOP p_228244_1_, int p_228244_2_, float p_228244_3_)
{
float f = p_228244_1_.getRowingTime(p_228244_2_, p_228244_3_);
ModelRenderer modelrenderer = this.paddles[p_228244_2_];
modelrenderer.xRot = (float) MathHelper.clampedLerp((double) (-(float) Math.PI / 3F), (double) -0.2617994F, (double) ((MathHelper.sin(-f) + 1.0F) / 2.0F));
modelrenderer.yRot = (float) MathHelper.clampedLerp((double) (-(float) Math.PI / 4F), (double) ((float) Math.PI / 4F), (double) ((MathHelper.sin(-f + 1.0F) + 1.0F) / 2.0F));
if (p_228244_2_ == 1)
{
modelrenderer.yRot = (float) Math.PI - modelrenderer.yRot;
}
}
}

View File

@ -1,68 +0,0 @@
package biomesoplenty.common.entity.item;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.Quaternion;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.Vector3f;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraft.client.renderer.entity.model.BoatModel;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.entity.item.BoatEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
public class BoatRendererBOP extends EntityRenderer<BoatEntityBOP>
{
private static final ResourceLocation[] BOAT_TEXTURES = new ResourceLocation[]{new ResourceLocation("biomesoplenty:textures/entity/boat/fir.png"), new ResourceLocation("biomesoplenty:textures/entity/boat/redwood.png"), new ResourceLocation("biomesoplenty:textures/entity/boat/cherry.png"), new ResourceLocation("biomesoplenty:textures/entity/boat/mahogany.png"), new ResourceLocation("biomesoplenty:textures/entity/boat/jacaranda.png"), new ResourceLocation("biomesoplenty:textures/entity/boat/palm.png"), new ResourceLocation("biomesoplenty:textures/entity/boat/willow.png"), new ResourceLocation("biomesoplenty:textures/entity/boat/dead.png"), new ResourceLocation("biomesoplenty:textures/entity/boat/magic.png"), new ResourceLocation("biomesoplenty:textures/entity/boat/umbran.png"), new ResourceLocation("biomesoplenty:textures/entity/boat/hellbark.png")};
protected final BoatModelBOP model = new BoatModelBOP();
public BoatRendererBOP(EntityRendererManager renderManagerIn)
{
super(renderManagerIn);
this.shadowRadius = 0.8F;
}
@Override
public void render(BoatEntityBOP p_225623_1_, float p_225623_2_, float p_225623_3_, MatrixStack p_225623_4_, IRenderTypeBuffer p_225623_5_, int p_225623_6_) {
p_225623_4_.pushPose();
p_225623_4_.translate(0.0D, 0.375D, 0.0D);
p_225623_4_.mulPose(Vector3f.YP.rotationDegrees(180.0F - p_225623_2_));
float f = (float)p_225623_1_.getHurtTime() - p_225623_3_;
float f1 = p_225623_1_.getDamage() - p_225623_3_;
if (f1 < 0.0F) {
f1 = 0.0F;
}
if (f > 0.0F) {
p_225623_4_.mulPose(Vector3f.XP.rotationDegrees(MathHelper.sin(f) * f * f1 / 10.0F * (float)p_225623_1_.getHurtDir()));
}
float f2 = p_225623_1_.getBubbleAngle(p_225623_3_);
if (!MathHelper.equal(f2, 0.0F)) {
p_225623_4_.mulPose(new Quaternion(new Vector3f(1.0F, 0.0F, 1.0F), p_225623_1_.getBubbleAngle(p_225623_3_), true));
}
p_225623_4_.scale(-1.0F, -1.0F, 1.0F);
p_225623_4_.mulPose(Vector3f.YP.rotationDegrees(90.0F));
this.model.setupAnim(p_225623_1_, p_225623_3_, 0.0F, -0.1F, 0.0F, 0.0F);
IVertexBuilder ivertexbuilder = p_225623_5_.getBuffer(this.model.renderType(this.getTextureLocation(p_225623_1_)));
this.model.renderToBuffer(p_225623_4_, ivertexbuilder, p_225623_6_, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F);
IVertexBuilder ivertexbuilder1 = p_225623_5_.getBuffer(RenderType.waterMask());
this.model.waterPatch().render(p_225623_4_, ivertexbuilder1, p_225623_6_, OverlayTexture.NO_OVERLAY);
p_225623_4_.popPose();
super.render(p_225623_1_, p_225623_2_, p_225623_3_, p_225623_4_, p_225623_5_, p_225623_6_);
}
@Override
public ResourceLocation getTextureLocation(BoatEntityBOP entity)
{
return BOAT_TEXTURES[entity.getBoatModel().ordinal()];
}
}

View File

@ -1,3 +0,0 @@
@javax.annotation.ParametersAreNonnullByDefault
@mcp.MethodsReturnNonnullByDefault
package biomesoplenty.common.entity.item;

View File

@ -1,79 +0,0 @@
package biomesoplenty.common.item;
import biomesoplenty.common.entity.item.BoatEntityBOP;
import biomesoplenty.common.entity.item.BoatModelBOP;
import net.minecraft.block.DispenserBlock;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.BoatEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Stats;
import net.minecraft.util.ActionResult;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.EntityPredicates;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.RayTraceContext;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import java.util.List;
import java.util.function.Predicate;
public class BoatItemBOP extends Item {
private static final Predicate<Entity> ENTITY_PREDICATE = EntityPredicates.NO_SPECTATORS.and(Entity::isPickable);
private final BoatEntityBOP.Type type;
public BoatItemBOP(BoatEntityBOP.Type typeIn, Item.Properties properties) {
super(properties);
this.type = typeIn;
DispenserBlock.registerBehavior(this, new DispenserBoatBehaviorBOP(typeIn));
}
@Override
public ActionResult<ItemStack> use(World worldIn, PlayerEntity playerIn, Hand handIn)
{
ItemStack itemstack = playerIn.getItemInHand(handIn);
RayTraceResult raytraceresult = getPlayerPOVHitResult(worldIn, playerIn, RayTraceContext.FluidMode.ANY);
if (raytraceresult.getType() == RayTraceResult.Type.MISS) {
return ActionResult.pass(itemstack);
} else {
Vec3d vec3d = playerIn.getViewVector(1.0F);
double d0 = 5.0D;
List<Entity> list = worldIn.getEntities(playerIn, playerIn.getBoundingBox().expandTowards(vec3d.scale(5.0D)).inflate(1.0D), ENTITY_PREDICATE);
if (!list.isEmpty()) {
Vec3d vec3d1 = playerIn.getEyePosition(1.0F);
for(Entity entity : list) {
AxisAlignedBB axisalignedbb = entity.getBoundingBox().inflate((double)entity.getPickRadius());
if (axisalignedbb.contains(vec3d1)) {
return ActionResult.pass(itemstack);
}
}
}
if (raytraceresult.getType() == RayTraceResult.Type.BLOCK) {
BoatEntityBOP boatentity = new BoatEntityBOP(worldIn, raytraceresult.getLocation().x, raytraceresult.getLocation().y, raytraceresult.getLocation().z);
boatentity.setBoatModel(this.type);
boatentity.yRot = playerIn.yRot;
if (!worldIn.noCollision(boatentity, boatentity.getBoundingBox().inflate(-0.1D))) {
return ActionResult.fail(itemstack);
} else {
if (!worldIn.isClientSide) {
worldIn.addFreshEntity(boatentity);
if (!playerIn.abilities.instabuild) {
itemstack.shrink(1);
}
}
playerIn.awardStat(Stats.ITEM_USED.get(this));
return ActionResult.success(itemstack);
}
} else {
return ActionResult.pass(itemstack);
}
}
}
}

View File

@ -1,59 +0,0 @@
package biomesoplenty.common.item;
import biomesoplenty.common.entity.item.BoatEntityBOP;
import net.minecraft.block.DispenserBlock;
import net.minecraft.dispenser.DefaultDispenseItemBehavior;
import net.minecraft.dispenser.IBlockSource;
import net.minecraft.entity.item.BoatEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.tags.FluidTags;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public class DispenserBoatBehaviorBOP extends DefaultDispenseItemBehavior
{
private final DefaultDispenseItemBehavior defaultDispenseItemBehavior = new DefaultDispenseItemBehavior();
private final BoatEntityBOP.Type type;
public DispenserBoatBehaviorBOP(BoatEntityBOP.Type typeIn) {
this.type = typeIn;
}
/**
* Dispense the specified stack, play the dispense sound and spawn particles.
*/
public ItemStack execute(IBlockSource source, ItemStack stack) {
Direction direction = source.getBlockState().getValue(DispenserBlock.FACING);
World world = source.getLevel();
double d0 = source.x() + (double)((float)direction.getStepX() * 1.125F);
double d1 = source.y() + (double)((float)direction.getStepY() * 1.125F);
double d2 = source.z() + (double)((float)direction.getStepZ() * 1.125F);
BlockPos blockpos = source.getPos().relative(direction);
double d3;
if (world.getFluidState(blockpos).is(FluidTags.WATER)) {
d3 = 1.0D;
} else {
if (!world.getBlockState(blockpos).isAir() || !world.getFluidState(blockpos.below()).is(FluidTags.WATER)) {
return this.defaultDispenseItemBehavior.dispense(source, stack);
}
d3 = 0.0D;
}
BoatEntityBOP boatentity = new BoatEntityBOP(world, d0, d1 + d3, d2);
boatentity.setBoatModel(this.type);
boatentity.yRot = direction.toYRot();
world.addFreshEntity(boatentity);
stack.shrink(1);
return stack;
}
/**
* Play the dispense sound from the specified block.
*/
protected void playSound(IBlockSource source) {
source.getLevel().levelEvent(1000, source.getPos(), 0);
}
}

View File

@ -10,36 +10,24 @@ package biomesoplenty.common.world;
import biomesoplenty.api.enums.BOPClimates;
import com.google.common.collect.Sets;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biomes;
import net.minecraft.world.biome.provider.BiomeProvider;
import net.minecraft.world.biome.provider.OverworldBiomeProvider;
import net.minecraft.world.biome.provider.OverworldBiomeProviderSettings;
import net.minecraft.world.gen.OverworldGenSettings;
import net.minecraft.world.gen.feature.structure.Structure;
import net.minecraft.world.gen.layer.Layer;
import net.minecraft.world.gen.layer.LayerUtil;
import net.minecraft.world.storage.WorldInfo;
import javax.annotation.Nullable;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.Set;
import java.util.stream.Collectors;
public class BOPBiomeProvider extends OverworldBiomeProvider
{
private final Layer noiseBiomeLayer;
protected final Set<Biome> possibleBiomes;
public BOPBiomeProvider(OverworldBiomeProviderSettings settingsProvider)
public BOPBiomeProvider(long seed)
{
super(settingsProvider);
super(seed, false, false);
this.possibleBiomes = Sets.newHashSet(super.possibleBiomes);
this.possibleBiomes.addAll(BOPClimates.getOverworldBiomes());
this.noiseBiomeLayer = BOPLayerUtil.createGenLayers(settingsProvider.getSeed(), settingsProvider.getGeneratorType(), (BOPOverworldGenSettings)settingsProvider.getGeneratorSettings());
this.noiseBiomeLayer = BOPLayerUtil.createGenLayers(seed, new BOPOverworldGenSettings());
}
@Override

View File

@ -10,7 +10,6 @@ package biomesoplenty.common.world;
import biomesoplenty.common.world.layer.*;
import biomesoplenty.common.world.layer.traits.LazyAreaLayerContextBOP;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.WorldType;
import net.minecraft.world.biome.Biomes;
import net.minecraft.world.gen.IExtendedNoiseRandom;
import net.minecraft.world.gen.area.IArea;
@ -108,7 +107,7 @@ public class BOPLayerUtil
return biomeFactory;
}
public static <T extends IArea, C extends IExtendedNoiseRandom<T>> IAreaFactory<T> createAreaFactories(WorldType worldType, BOPOverworldGenSettings settings, LongFunction<C> contextFactory)
public static <T extends IArea, C extends IExtendedNoiseRandom<T>> IAreaFactory<T> createAreaFactories(BOPOverworldGenSettings settings, LongFunction<C> contextFactory)
{
// Create the initial land and sea layer. Is also responsible for adding deep oceans
// and mushroom islands
@ -126,8 +125,6 @@ public class BOPLayerUtil
riverSize = settings.getRiverSize();
}
biomeSize = LayerUtil.getModdedBiomeSize(worldType, biomeSize);
// Create the climates
IAreaFactory<T> climateFactory = createClimateFactory(contextFactory, settings);
@ -170,9 +167,9 @@ public class BOPLayerUtil
return biomesFactory;
}
public static Layer createGenLayers(long seed, WorldType worldType, BOPOverworldGenSettings settings)
public static Layer createGenLayers(long seed, BOPOverworldGenSettings settings)
{
IAreaFactory<LazyArea> factory = createAreaFactories(worldType, settings, (seedModifier) ->
IAreaFactory<LazyArea> factory = createAreaFactories(settings, (seedModifier) ->
{
return new LazyAreaLayerContextBOP(1, seed, seedModifier);
});

View File

@ -7,13 +7,11 @@
******************************************************************************/
package biomesoplenty.common.world;
import biomesoplenty.common.world.layer.BOPShoreLayer;
import biomesoplenty.common.world.layer.LandLayer;
import biomesoplenty.common.world.layer.NetherBiomeLayer;
import biomesoplenty.common.world.layer.BOPShoreLayer;
import biomesoplenty.common.world.layer.traits.LazyAreaLayerContextBOP;
import net.minecraft.world.WorldType;
import net.minecraft.world.gen.IExtendedNoiseRandom;
import net.minecraft.world.gen.OverworldGenSettings;
import net.minecraft.world.gen.area.IArea;
import net.minecraft.world.gen.area.IAreaFactory;
import net.minecraft.world.gen.area.LazyArea;
@ -31,7 +29,7 @@ public class BOPNetherLayerUtil
return biomeFactory;
}
public static <T extends IArea, C extends IExtendedNoiseRandom<T>> IAreaFactory<T> createAreaFactories(WorldType worldType, OverworldGenSettings settings, LongFunction<C> contextFactory)
public static <T extends IArea, C extends IExtendedNoiseRandom<T>> IAreaFactory<T> createAreaFactories(LongFunction<C> contextFactory)
{
int biomeSize = 3;
@ -53,9 +51,9 @@ public class BOPNetherLayerUtil
return biomesFactory;
}
public static Layer createGenLayers(long seed, WorldType worldType, OverworldGenSettings settings)
public static Layer createGenLayers(long seed)
{
IAreaFactory<LazyArea> factory = createAreaFactories(worldType, settings, (seedModifier) ->
IAreaFactory<LazyArea> factory = createAreaFactories((seedModifier) ->
{
return new LazyAreaLayerContextBOP(1, seed, seedModifier);
});

View File

@ -8,9 +8,8 @@
package biomesoplenty.common.world;
import biomesoplenty.init.ModConfig;
import net.minecraft.world.gen.OverworldGenSettings;
public class BOPOverworldGenSettings extends OverworldGenSettings
public class BOPOverworldGenSettings
{
public enum LandMassScheme
{
@ -78,13 +77,10 @@ public class BOPOverworldGenSettings extends OverworldGenSettings
}
}
@Override
public int getBiomeSize()
{
return ModConfig.GenerationConfig.biomeSize.get().value;
}
@Override
public int getRiverSize()
{
return ModConfig.GenerationConfig.riverSize.get().value;

View File

@ -0,0 +1,28 @@
/*******************************************************************************
* Copyright 2014-2020, the Biomes O' Plenty Team
*
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
*
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
******************************************************************************/
package biomesoplenty.common.world;
import net.minecraft.client.gui.screen.BiomeGeneratorTypeScreens;
import net.minecraft.world.biome.provider.OverworldBiomeProvider;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.DimensionSettings;
import net.minecraft.world.gen.NoiseChunkGenerator;
public class BiomeGeneratorTypeScreenBOP extends BiomeGeneratorTypeScreens
{
public BiomeGeneratorTypeScreenBOP()
{
super("biomesoplenty");
}
@Override
protected ChunkGenerator generator(long seed)
{
return new NoiseChunkGenerator(new BOPBiomeProvider(seed), seed, DimensionSettings.Preset.OVERWORLD.settings());
}
}

View File

@ -1,21 +0,0 @@
/*******************************************************************************
* Copyright 2014-2019, the Biomes O' Plenty Team
*
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
*
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
******************************************************************************/
package biomesoplenty.common.world;
import net.minecraft.world.IWorld;
import net.minecraft.world.biome.provider.BiomeProvider;
import net.minecraft.world.gen.OverworldChunkGenerator;
import net.minecraft.world.gen.OverworldGenSettings;
public class ChunkGeneratorOverworldBOP extends OverworldChunkGenerator
{
public ChunkGeneratorOverworldBOP(IWorld world, BiomeProvider provider, BOPOverworldGenSettings settings)
{
super(world, provider, settings);
}
}

View File

@ -1,49 +0,0 @@
/*******************************************************************************
* Copyright 2014-2019, the Biomes O' Plenty Team
*
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
*
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
******************************************************************************/
package biomesoplenty.common.world;
import biomesoplenty.api.enums.BOPClimates;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biomes;
import net.minecraft.world.biome.provider.BiomeProvider;
import net.minecraft.world.biome.provider.OverworldBiomeProvider;
import net.minecraft.world.biome.provider.OverworldBiomeProviderSettings;
import net.minecraft.world.gen.OverworldGenSettings;
import net.minecraft.world.gen.feature.structure.Structure;
import net.minecraft.world.gen.layer.Layer;
import net.minecraft.world.gen.layer.LayerUtil;
import net.minecraft.world.storage.WorldInfo;
import javax.annotation.Nullable;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.Set;
import java.util.stream.Collectors;
public class NetherBiomeProvider extends BiomeProvider
{
private final Layer noiseBiomeLayer;
public NetherBiomeProvider(OverworldBiomeProviderSettings settingsProvider)
{
super(BOPClimates.NETHER.getLandBiomes().stream().map(weightedBiomeEntry -> weightedBiomeEntry.biome).collect(Collectors.toSet()));
this.noiseBiomeLayer = BOPNetherLayerUtil.createGenLayers(settingsProvider.getSeed(), settingsProvider.getGeneratorType(), settingsProvider.getGeneratorSettings());
}
@Override
public Biome getNoiseBiome(int x, int y, int z)
{
return this.noiseBiomeLayer.get(x, z);
}
}

View File

@ -0,0 +1,41 @@
/*******************************************************************************
* Copyright 2014-2019, the Biomes O' Plenty Team
*
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
*
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
******************************************************************************/
package biomesoplenty.common.world;
import com.google.common.collect.ImmutableList;
import com.mojang.datafixers.util.Pair;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biomes;
import net.minecraft.world.biome.provider.NetherBiomeProvider;
import net.minecraft.world.gen.layer.Layer;
import java.util.List;
import java.util.Optional;
public class NetherBiomeProviderBOP extends NetherBiomeProvider
{
private final Layer noiseBiomeLayer;
public NetherBiomeProviderBOP(long seed)
{
super(seed, getParameters(), Optional.of(NetherBiomeProvider.Preset.NETHER));
this.noiseBiomeLayer = BOPNetherLayerUtil.createGenLayers(seed);
}
@Override
public Biome getNoiseBiome(int x, int y, int z)
{
return this.noiseBiomeLayer.get(x, z);
}
private static List<Pair<Biome.Attributes, Biome>> getParameters()
{
ImmutableList<Biome> biomeList = ImmutableList.of(Biomes.NETHER_WASTES, Biomes.SOUL_SAND_VALLEY, Biomes.CRIMSON_FOREST, Biomes.WARPED_FOREST, Biomes.BASALT_DELTAS);
return biomeList.stream().flatMap((biome) -> biome.optimalParameters().map((attribute) -> Pair.of(attribute, biome))).collect(ImmutableList.toImmutableList());
}
}

View File

@ -1,54 +0,0 @@
/*******************************************************************************
* Copyright 2014-2019, the Biomes O' Plenty Team
*
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
*
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
******************************************************************************/
package biomesoplenty.common.world;
import net.minecraft.block.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.WorldType;
import net.minecraft.world.biome.provider.OverworldBiomeProviderSettings;
import net.minecraft.world.dimension.DimensionType;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.ChunkGeneratorType;
import net.minecraft.world.gen.NetherGenSettings;
import net.minecraft.world.gen.OverworldGenSettings;
public class WorldTypeBOP extends WorldType
{
public WorldTypeBOP()
{
super("biomesoplenty");
}
@Override
public ChunkGenerator<?> createChunkGenerator(World world)
{
if (world.getDimension().getType() == DimensionType.OVERWORLD)
{
BOPOverworldGenSettings genSettings = new BOPOverworldGenSettings();
OverworldBiomeProviderSettings biomeProviderSettings = new OverworldBiomeProviderSettings(world.getLevelData());
biomeProviderSettings.setGeneratorSettings(genSettings);
return new ChunkGeneratorOverworldBOP(world, new BOPBiomeProvider(biomeProviderSettings), genSettings);
}
else if (world.getDimension().getType() == DimensionType.NETHER)
{
NetherGenSettings nethergensettings = ChunkGeneratorType.CAVES.createSettings();
nethergensettings.setDefaultBlock(Blocks.NETHERRACK.defaultBlockState());
nethergensettings.setDefaultFluid(Blocks.LAVA.defaultBlockState());
// The nether shares biome provider settings with the overworld
OverworldBiomeProviderSettings biomeProviderSettings = new OverworldBiomeProviderSettings(world.getLevelData());
return ChunkGeneratorType.CAVES.create(world, new NetherBiomeProvider(biomeProviderSettings), nethergensettings);
}
else
{
return super.createChunkGenerator(world);
}
}
}

View File

@ -332,7 +332,7 @@ public class BigTreeFeature extends TreeFeatureBase
if (height == -1) {
return false;
} else {
this.setDirtAt(world, pos.below(), pos);
this.setBlock(world, pos.below(), Blocks.DIRT.defaultBlockState());
int trunkHeight = (int)((double)height * this.trunkHeightScale);
if (trunkHeight >= height) {

View File

@ -67,7 +67,7 @@ public class PalmTreeFeature extends TreeFeatureBase
int leavesRadius = 2;
int heightMinusTop = height - leavesRadius - 1;
boolean slant = false;
Direction direction = Direction.getRandomFace(random); //The direction the palm tree curves towards
Direction direction = Direction.getRandom(random); //The direction the palm tree curves towards
if (direction == Direction.DOWN || direction == Direction.UP)
{
slant = false;

View File

@ -12,6 +12,7 @@ import biomesoplenty.common.util.block.BlockUtil;
import biomesoplenty.common.util.block.IBlockPosQuery;
import net.minecraft.block.*;
import net.minecraft.state.IProperty;
import net.minecraft.state.Property;
import net.minecraft.tags.BlockTags;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
@ -20,11 +21,12 @@ import net.minecraft.world.IWorld;
import net.minecraft.world.gen.IWorldGenerationReader;
import net.minecraft.world.gen.feature.AbstractTreeFeature;
import net.minecraft.world.gen.feature.BaseTreeFeatureConfig;
import net.minecraft.world.gen.feature.TreeFeature;
import java.util.Random;
import java.util.Set;
public abstract class TreeFeatureBase extends AbstractTreeFeature<BaseTreeFeatureConfig>
public abstract class TreeFeatureBase extends TreeFeature
{
protected static abstract class BuilderBase<T extends BuilderBase, F extends TreeFeatureBase>
{
@ -96,7 +98,7 @@ public abstract class TreeFeatureBase extends AbstractTreeFeature<BaseTreeFeatur
protected final int minHeight;
protected final int maxHeight;
protected IProperty logAxisProperty;
protected Property logAxisProperty;
protected TreeFeatureBase(IBlockPosQuery placeOn, IBlockPosQuery replace, BlockState log, BlockState leaves, BlockState altLeaves, BlockState vine, BlockState hanging, BlockState trunkFruit, int minHeight, int maxHeight)
{
@ -206,7 +208,7 @@ public abstract class TreeFeatureBase extends AbstractTreeFeature<BaseTreeFeatur
}
else
{
this.setBlock(world, pos, state, boundingBox);
this.setBlock(world, pos, state);
changedBlocks.add(pos.immutable());
return true;
}

View File

@ -12,7 +12,6 @@ import biomesoplenty.common.biome.BiomeBOP;
import biomesoplenty.common.biome.BiomeRegistry;
import biomesoplenty.common.biome.nether.*;
import biomesoplenty.common.biome.overworld.*;
import biomesoplenty.common.world.WorldTypeBOP;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;

View File

@ -84,11 +84,11 @@ public class ModBlocks
fir_planks = registerBlock(new Block(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_WHITE).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "fir_planks");
fir_stairs = registerBlock(new StairsBlock(fir_planks.defaultBlockState(), Block.Properties.copy(fir_planks)), "fir_stairs");
fir_slab = registerBlock(new SlabBlock(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_WHITE).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "fir_slab");
fir_fence = registerBlock(new FenceBlock(Block.Properties.of(Material.WOOD, fir_planks.materialColor).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "fir_fence");
fir_fence_gate = registerBlock(new FenceGateBlock(Block.Properties.of(Material.WOOD, fir_planks.materialColor).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "fir_fence_gate");
fir_door = registerBlock(new DoorBlock(Block.Properties.of(Material.WOOD, fir_planks.materialColor).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "fir_door");
fir_fence = registerBlock(new FenceBlock(Block.Properties.of(Material.WOOD, fir_planks.defaultMaterialColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "fir_fence");
fir_fence_gate = registerBlock(new FenceGateBlock(Block.Properties.of(Material.WOOD, fir_planks.defaultMaterialColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "fir_fence_gate");
fir_door = registerBlock(new DoorBlock(Block.Properties.of(Material.WOOD, fir_planks.defaultMaterialColor()).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "fir_door");
fir_trapdoor = registerBlock(new TrapDoorBlock(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_WHITE).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "fir_trapdoor");
fir_pressure_plate = registerBlock(new PressurePlateBlock(PressurePlateBlock.Sensitivity.EVERYTHING, Block.Properties.of(Material.WOOD, fir_planks.materialColor).noCollission().strength(0.5F).sound(SoundType.WOOD)), "fir_pressure_plate");
fir_pressure_plate = registerBlock(new PressurePlateBlock(PressurePlateBlock.Sensitivity.EVERYTHING, Block.Properties.of(Material.WOOD, fir_planks.defaultMaterialColor()).noCollission().strength(0.5F).sound(SoundType.WOOD)), "fir_pressure_plate");
fir_button = registerBlock(new WoodButtonBlock(Block.Properties.of(Material.DECORATION).noCollission().strength(0.5F).sound(SoundType.WOOD)), "fir_button");
redwood_sapling = registerBlock(new SaplingBlockBOP(new RedwoodTree(), Block.Properties.of(Material.PLANT).noCollission().randomTicks().instabreak().sound(SoundType.GRASS)), "redwood_sapling");
@ -100,11 +100,11 @@ public class ModBlocks
redwood_planks = registerBlock(new Block(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_ORANGE).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "redwood_planks");
redwood_stairs = registerBlock(new StairsBlock(redwood_planks.defaultBlockState(), Block.Properties.copy(redwood_planks)), "redwood_stairs");
redwood_slab = registerBlock(new SlabBlock(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_ORANGE).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "redwood_slab");
redwood_fence = registerBlock(new FenceBlock(Block.Properties.of(Material.WOOD, redwood_planks.materialColor).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "redwood_fence");
redwood_fence_gate = registerBlock(new FenceGateBlock(Block.Properties.of(Material.WOOD, redwood_planks.materialColor).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "redwood_fence_gate");
redwood_door = registerBlock(new DoorBlock(Block.Properties.of(Material.WOOD, redwood_planks.materialColor).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "redwood_door");
redwood_fence = registerBlock(new FenceBlock(Block.Properties.of(Material.WOOD, redwood_planks.defaultMaterialColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "redwood_fence");
redwood_fence_gate = registerBlock(new FenceGateBlock(Block.Properties.of(Material.WOOD, redwood_planks.defaultMaterialColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "redwood_fence_gate");
redwood_door = registerBlock(new DoorBlock(Block.Properties.of(Material.WOOD, redwood_planks.defaultMaterialColor()).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "redwood_door");
redwood_trapdoor = registerBlock(new TrapDoorBlock(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_ORANGE).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "redwood_trapdoor");
redwood_pressure_plate = registerBlock(new PressurePlateBlock(PressurePlateBlock.Sensitivity.EVERYTHING, Block.Properties.of(Material.WOOD, redwood_planks.materialColor).noCollission().strength(0.5F).sound(SoundType.WOOD)), "redwood_pressure_plate");
redwood_pressure_plate = registerBlock(new PressurePlateBlock(PressurePlateBlock.Sensitivity.EVERYTHING, Block.Properties.of(Material.WOOD, redwood_planks.defaultMaterialColor()).noCollission().strength(0.5F).sound(SoundType.WOOD)), "redwood_pressure_plate");
redwood_button = registerBlock(new WoodButtonBlock(Block.Properties.of(Material.DECORATION).noCollission().strength(0.5F).sound(SoundType.WOOD)), "redwood_button");
white_cherry_sapling = registerBlock(new SaplingBlockBOP(new WhiteCherryTree(), Block.Properties.of(Material.PLANT).noCollission().randomTicks().instabreak().sound(SoundType.GRASS)), "white_cherry_sapling");
@ -118,11 +118,11 @@ public class ModBlocks
cherry_planks = registerBlock(new Block(Block.Properties.of(Material.WOOD, MaterialColor.COLOR_RED).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "cherry_planks");
cherry_stairs = registerBlock(new StairsBlock(cherry_planks.defaultBlockState(), Block.Properties.copy(cherry_planks)), "cherry_stairs");
cherry_slab = registerBlock(new SlabBlock(Block.Properties.of(Material.WOOD, MaterialColor.COLOR_RED).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "cherry_slab");
cherry_fence = registerBlock(new FenceBlock(Block.Properties.of(Material.WOOD, cherry_planks.materialColor).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "cherry_fence");
cherry_fence_gate = registerBlock(new FenceGateBlock(Block.Properties.of(Material.WOOD, cherry_planks.materialColor).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "cherry_fence_gate");
cherry_door = registerBlock(new DoorBlock(Block.Properties.of(Material.WOOD, cherry_planks.materialColor).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "cherry_door");
cherry_fence = registerBlock(new FenceBlock(Block.Properties.of(Material.WOOD, cherry_planks.defaultMaterialColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "cherry_fence");
cherry_fence_gate = registerBlock(new FenceGateBlock(Block.Properties.of(Material.WOOD, cherry_planks.defaultMaterialColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "cherry_fence_gate");
cherry_door = registerBlock(new DoorBlock(Block.Properties.of(Material.WOOD, cherry_planks.defaultMaterialColor()).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "cherry_door");
cherry_trapdoor = registerBlock(new TrapDoorBlock(Block.Properties.of(Material.WOOD, MaterialColor.COLOR_RED).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "cherry_trapdoor");
cherry_pressure_plate = registerBlock(new PressurePlateBlock(PressurePlateBlock.Sensitivity.EVERYTHING, Block.Properties.of(Material.WOOD, cherry_planks.materialColor).noCollission().strength(0.5F).sound(SoundType.WOOD)), "cherry_pressure_plate");
cherry_pressure_plate = registerBlock(new PressurePlateBlock(PressurePlateBlock.Sensitivity.EVERYTHING, Block.Properties.of(Material.WOOD, cherry_planks.defaultMaterialColor()).noCollission().strength(0.5F).sound(SoundType.WOOD)), "cherry_pressure_plate");
cherry_button = registerBlock(new WoodButtonBlock(Block.Properties.of(Material.DECORATION).noCollission().strength(0.5F).sound(SoundType.WOOD)), "cherry_button");
mahogany_sapling = registerBlock(new SaplingBlockBOP(new MahoganyTree(), Block.Properties.of(Material.PLANT).noCollission().randomTicks().instabreak().sound(SoundType.GRASS)), "mahogany_sapling");
@ -134,11 +134,11 @@ public class ModBlocks
mahogany_planks = registerBlock(new Block(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_PINK).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "mahogany_planks");
mahogany_stairs = registerBlock(new StairsBlock(mahogany_planks.defaultBlockState(), Block.Properties.copy(mahogany_planks)), "mahogany_stairs");
mahogany_slab = registerBlock(new SlabBlock(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_PINK).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "mahogany_slab");
mahogany_fence = registerBlock(new FenceBlock(Block.Properties.of(Material.WOOD, mahogany_planks.materialColor).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "mahogany_fence");
mahogany_fence_gate = registerBlock(new FenceGateBlock(Block.Properties.of(Material.WOOD, mahogany_planks.materialColor).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "mahogany_fence_gate");
mahogany_door = registerBlock(new DoorBlock(Block.Properties.of(Material.WOOD, mahogany_planks.materialColor).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "mahogany_door");
mahogany_fence = registerBlock(new FenceBlock(Block.Properties.of(Material.WOOD, mahogany_planks.defaultMaterialColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "mahogany_fence");
mahogany_fence_gate = registerBlock(new FenceGateBlock(Block.Properties.of(Material.WOOD, mahogany_planks.defaultMaterialColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "mahogany_fence_gate");
mahogany_door = registerBlock(new DoorBlock(Block.Properties.of(Material.WOOD, mahogany_planks.defaultMaterialColor()).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "mahogany_door");
mahogany_trapdoor = registerBlock(new TrapDoorBlock(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_PINK).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "mahogany_trapdoor");
mahogany_pressure_plate = registerBlock(new PressurePlateBlock(PressurePlateBlock.Sensitivity.EVERYTHING, Block.Properties.of(Material.WOOD, mahogany_planks.materialColor).noCollission().strength(0.5F).sound(SoundType.WOOD)), "mahogany_pressure_plate");
mahogany_pressure_plate = registerBlock(new PressurePlateBlock(PressurePlateBlock.Sensitivity.EVERYTHING, Block.Properties.of(Material.WOOD, mahogany_planks.defaultMaterialColor()).noCollission().strength(0.5F).sound(SoundType.WOOD)), "mahogany_pressure_plate");
mahogany_button = registerBlock(new WoodButtonBlock(Block.Properties.of(Material.DECORATION).noCollission().strength(0.5F).sound(SoundType.WOOD)), "mahogany_button");
jacaranda_sapling = registerBlock(new SaplingBlockBOP(new JacarandaTree(), Block.Properties.of(Material.PLANT).noCollission().randomTicks().instabreak().sound(SoundType.GRASS)), "jacaranda_sapling");
@ -150,11 +150,11 @@ public class ModBlocks
jacaranda_planks = registerBlock(new Block(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_WHITE).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "jacaranda_planks");
jacaranda_stairs = registerBlock(new StairsBlock(jacaranda_planks.defaultBlockState(), Block.Properties.copy(jacaranda_planks)), "jacaranda_stairs");
jacaranda_slab = registerBlock(new SlabBlock(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_WHITE).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "jacaranda_slab");
jacaranda_fence = registerBlock(new FenceBlock(Block.Properties.of(Material.WOOD, jacaranda_planks.materialColor).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "jacaranda_fence");
jacaranda_fence_gate = registerBlock(new FenceGateBlock(Block.Properties.of(Material.WOOD, jacaranda_planks.materialColor).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "jacaranda_fence_gate");
jacaranda_door = registerBlock(new DoorBlock(Block.Properties.of(Material.WOOD, jacaranda_planks.materialColor).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "jacaranda_door");
jacaranda_fence = registerBlock(new FenceBlock(Block.Properties.of(Material.WOOD, jacaranda_planks.defaultMaterialColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "jacaranda_fence");
jacaranda_fence_gate = registerBlock(new FenceGateBlock(Block.Properties.of(Material.WOOD, jacaranda_planks.defaultMaterialColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "jacaranda_fence_gate");
jacaranda_door = registerBlock(new DoorBlock(Block.Properties.of(Material.WOOD, jacaranda_planks.defaultMaterialColor()).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "jacaranda_door");
jacaranda_trapdoor = registerBlock(new TrapDoorBlock(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_WHITE).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "jacaranda_trapdoor");
jacaranda_pressure_plate = registerBlock(new PressurePlateBlock(PressurePlateBlock.Sensitivity.EVERYTHING, Block.Properties.of(Material.WOOD, jacaranda_planks.materialColor).noCollission().strength(0.5F).sound(SoundType.WOOD)), "jacaranda_pressure_plate");
jacaranda_pressure_plate = registerBlock(new PressurePlateBlock(PressurePlateBlock.Sensitivity.EVERYTHING, Block.Properties.of(Material.WOOD, jacaranda_planks.defaultMaterialColor()).noCollission().strength(0.5F).sound(SoundType.WOOD)), "jacaranda_pressure_plate");
jacaranda_button = registerBlock(new WoodButtonBlock(Block.Properties.of(Material.DECORATION).noCollission().strength(0.5F).sound(SoundType.WOOD)), "jacaranda_button");
palm_sapling = registerBlock(new SaplingBlockBOP(new PalmTree(), Block.Properties.of(Material.PLANT).noCollission().randomTicks().instabreak().sound(SoundType.GRASS)), "palm_sapling");
@ -166,11 +166,11 @@ public class ModBlocks
palm_planks = registerBlock(new Block(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_YELLOW).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "palm_planks");
palm_stairs = registerBlock(new StairsBlock(palm_planks.defaultBlockState(), Block.Properties.copy(palm_planks)), "palm_stairs");
palm_slab = registerBlock(new SlabBlock(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_YELLOW).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "palm_slab");
palm_fence = registerBlock(new FenceBlock(Block.Properties.of(Material.WOOD, palm_planks.materialColor).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "palm_fence");
palm_fence_gate = registerBlock(new FenceGateBlock(Block.Properties.of(Material.WOOD, palm_planks.materialColor).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "palm_fence_gate");
palm_door = registerBlock(new DoorBlock(Block.Properties.of(Material.WOOD, palm_planks.materialColor).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "palm_door");
palm_fence = registerBlock(new FenceBlock(Block.Properties.of(Material.WOOD, palm_planks.defaultMaterialColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "palm_fence");
palm_fence_gate = registerBlock(new FenceGateBlock(Block.Properties.of(Material.WOOD, palm_planks.defaultMaterialColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "palm_fence_gate");
palm_door = registerBlock(new DoorBlock(Block.Properties.of(Material.WOOD, palm_planks.defaultMaterialColor()).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "palm_door");
palm_trapdoor = registerBlock(new TrapDoorBlock(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_YELLOW).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "palm_trapdoor");
palm_pressure_plate = registerBlock(new PressurePlateBlock(PressurePlateBlock.Sensitivity.EVERYTHING, Block.Properties.of(Material.WOOD, palm_planks.materialColor).noCollission().strength(0.5F).sound(SoundType.WOOD)), "palm_pressure_plate");
palm_pressure_plate = registerBlock(new PressurePlateBlock(PressurePlateBlock.Sensitivity.EVERYTHING, Block.Properties.of(Material.WOOD, palm_planks.defaultMaterialColor()).noCollission().strength(0.5F).sound(SoundType.WOOD)), "palm_pressure_plate");
palm_button = registerBlock(new WoodButtonBlock(Block.Properties.of(Material.DECORATION).noCollission().strength(0.5F).sound(SoundType.WOOD)), "palm_button");
willow_sapling = registerBlock(new SaplingBlockBOP(new WillowTree(), Block.Properties.of(Material.PLANT).noCollission().randomTicks().instabreak().sound(SoundType.GRASS)), "willow_sapling");
@ -182,11 +182,11 @@ public class ModBlocks
willow_planks = registerBlock(new Block(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_LIGHT_GREEN).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "willow_planks");
willow_stairs = registerBlock(new StairsBlock(willow_planks.defaultBlockState(), Block.Properties.copy(willow_planks)), "willow_stairs");
willow_slab = registerBlock(new SlabBlock(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_LIGHT_GREEN).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "willow_slab");
willow_fence = registerBlock(new FenceBlock(Block.Properties.of(Material.WOOD, willow_planks.materialColor).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "willow_fence");
willow_fence_gate = registerBlock(new FenceGateBlock(Block.Properties.of(Material.WOOD, willow_planks.materialColor).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "willow_fence_gate");
willow_door = registerBlock(new DoorBlock(Block.Properties.of(Material.WOOD, willow_planks.materialColor).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "willow_door");
willow_fence = registerBlock(new FenceBlock(Block.Properties.of(Material.WOOD, willow_planks.defaultMaterialColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "willow_fence");
willow_fence_gate = registerBlock(new FenceGateBlock(Block.Properties.of(Material.WOOD, willow_planks.defaultMaterialColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "willow_fence_gate");
willow_door = registerBlock(new DoorBlock(Block.Properties.of(Material.WOOD, willow_planks.defaultMaterialColor()).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "willow_door");
willow_trapdoor = registerBlock(new TrapDoorBlock(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_LIGHT_GREEN).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "willow_trapdoor");
willow_pressure_plate = registerBlock(new PressurePlateBlock(PressurePlateBlock.Sensitivity.EVERYTHING, Block.Properties.of(Material.WOOD, willow_planks.materialColor).noCollission().strength(0.5F).sound(SoundType.WOOD)), "willow_pressure_plate");
willow_pressure_plate = registerBlock(new PressurePlateBlock(PressurePlateBlock.Sensitivity.EVERYTHING, Block.Properties.of(Material.WOOD, willow_planks.defaultMaterialColor()).noCollission().strength(0.5F).sound(SoundType.WOOD)), "willow_pressure_plate");
willow_button = registerBlock(new WoodButtonBlock(Block.Properties.of(Material.DECORATION).noCollission().strength(0.5F).sound(SoundType.WOOD)), "willow_button");
dead_sapling = registerBlock(new SaplingBlockBOP(new DeadTree(), Block.Properties.of(Material.PLANT).noCollission().randomTicks().instabreak().sound(SoundType.GRASS)), "dead_sapling");
@ -198,11 +198,11 @@ public class ModBlocks
dead_planks = registerBlock(new Block(Block.Properties.of(Material.WOOD, MaterialColor.STONE).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "dead_planks");
dead_stairs = registerBlock(new StairsBlock(dead_planks.defaultBlockState(), Block.Properties.copy(dead_planks)), "dead_stairs");
dead_slab = registerBlock(new SlabBlock(Block.Properties.of(Material.WOOD, MaterialColor.STONE).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "dead_slab");
dead_fence = registerBlock(new FenceBlock(Block.Properties.of(Material.WOOD, dead_planks.materialColor).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "dead_fence");
dead_fence_gate = registerBlock(new FenceGateBlock(Block.Properties.of(Material.WOOD, dead_planks.materialColor).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "dead_fence_gate");
dead_door = registerBlock(new DoorBlock(Block.Properties.of(Material.WOOD, dead_planks.materialColor).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "dead_door");
dead_fence = registerBlock(new FenceBlock(Block.Properties.of(Material.WOOD, dead_planks.defaultMaterialColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "dead_fence");
dead_fence_gate = registerBlock(new FenceGateBlock(Block.Properties.of(Material.WOOD, dead_planks.defaultMaterialColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "dead_fence_gate");
dead_door = registerBlock(new DoorBlock(Block.Properties.of(Material.WOOD, dead_planks.defaultMaterialColor()).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "dead_door");
dead_trapdoor = registerBlock(new TrapDoorBlock(Block.Properties.of(Material.WOOD, MaterialColor.STONE).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "dead_trapdoor");
dead_pressure_plate = registerBlock(new PressurePlateBlock(PressurePlateBlock.Sensitivity.EVERYTHING, Block.Properties.of(Material.WOOD, dead_planks.materialColor).noCollission().strength(0.5F).sound(SoundType.WOOD)), "dead_pressure_plate");
dead_pressure_plate = registerBlock(new PressurePlateBlock(PressurePlateBlock.Sensitivity.EVERYTHING, Block.Properties.of(Material.WOOD, dead_planks.defaultMaterialColor()).noCollission().strength(0.5F).sound(SoundType.WOOD)), "dead_pressure_plate");
dead_button = registerBlock(new WoodButtonBlock(Block.Properties.of(Material.DECORATION).noCollission().strength(0.5F).sound(SoundType.WOOD)), "dead_button");
magic_sapling = registerBlock(new SaplingBlockBOP(new MagicTree(), Block.Properties.of(Material.PLANT).noCollission().randomTicks().instabreak().sound(SoundType.GRASS)), "magic_sapling");
@ -214,11 +214,11 @@ public class ModBlocks
magic_planks = registerBlock(new Block(Block.Properties.of(Material.WOOD, MaterialColor.COLOR_BLUE).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "magic_planks");
magic_stairs = registerBlock(new StairsBlock(magic_planks.defaultBlockState(), Block.Properties.copy(magic_planks)), "magic_stairs");
magic_slab = registerBlock(new SlabBlock(Block.Properties.of(Material.WOOD, MaterialColor.COLOR_BLUE).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "magic_slab");
magic_fence = registerBlock(new FenceBlock(Block.Properties.of(Material.WOOD, magic_planks.materialColor).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "magic_fence");
magic_fence_gate = registerBlock(new FenceGateBlock(Block.Properties.of(Material.WOOD, magic_planks.materialColor).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "magic_fence_gate");
magic_door = registerBlock(new DoorBlock(Block.Properties.of(Material.WOOD, magic_planks.materialColor).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "magic_door");
magic_fence = registerBlock(new FenceBlock(Block.Properties.of(Material.WOOD, magic_planks.defaultMaterialColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "magic_fence");
magic_fence_gate = registerBlock(new FenceGateBlock(Block.Properties.of(Material.WOOD, magic_planks.defaultMaterialColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "magic_fence_gate");
magic_door = registerBlock(new DoorBlock(Block.Properties.of(Material.WOOD, magic_planks.defaultMaterialColor()).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "magic_door");
magic_trapdoor = registerBlock(new TrapDoorBlock(Block.Properties.of(Material.WOOD, MaterialColor.COLOR_BLUE).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "magic_trapdoor");
magic_pressure_plate = registerBlock(new PressurePlateBlock(PressurePlateBlock.Sensitivity.EVERYTHING, Block.Properties.of(Material.WOOD, magic_planks.materialColor).noCollission().strength(0.5F).sound(SoundType.WOOD)), "magic_pressure_plate");
magic_pressure_plate = registerBlock(new PressurePlateBlock(PressurePlateBlock.Sensitivity.EVERYTHING, Block.Properties.of(Material.WOOD, magic_planks.defaultMaterialColor()).noCollission().strength(0.5F).sound(SoundType.WOOD)), "magic_pressure_plate");
magic_button = registerBlock(new WoodButtonBlock(Block.Properties.of(Material.DECORATION).noCollission().strength(0.5F).sound(SoundType.WOOD)), "magic_button");
umbran_sapling = registerBlock(new SaplingBlockBOP(new UmbranTree(), Block.Properties.of(Material.PLANT).noCollission().randomTicks().instabreak().sound(SoundType.GRASS)), "umbran_sapling");
@ -230,11 +230,11 @@ public class ModBlocks
umbran_planks = registerBlock(new Block(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_BLUE).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "umbran_planks");
umbran_stairs = registerBlock(new StairsBlock(umbran_planks.defaultBlockState(), Block.Properties.copy(umbran_planks)), "umbran_stairs");
umbran_slab = registerBlock(new SlabBlock(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_BLUE).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "umbran_slab");
umbran_fence = registerBlock(new FenceBlock(Block.Properties.of(Material.WOOD, umbran_planks.materialColor).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "umbran_fence");
umbran_fence_gate = registerBlock(new FenceGateBlock(Block.Properties.of(Material.WOOD, umbran_planks.materialColor).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "umbran_fence_gate");
umbran_door = registerBlock(new DoorBlock(Block.Properties.of(Material.WOOD, umbran_planks.materialColor).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "umbran_door");
umbran_fence = registerBlock(new FenceBlock(Block.Properties.of(Material.WOOD, umbran_planks.defaultMaterialColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "umbran_fence");
umbran_fence_gate = registerBlock(new FenceGateBlock(Block.Properties.of(Material.WOOD, umbran_planks.defaultMaterialColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "umbran_fence_gate");
umbran_door = registerBlock(new DoorBlock(Block.Properties.of(Material.WOOD, umbran_planks.defaultMaterialColor()).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "umbran_door");
umbran_trapdoor = registerBlock(new TrapDoorBlock(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_BLUE).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "umbran_trapdoor");
umbran_pressure_plate = registerBlock(new PressurePlateBlock(PressurePlateBlock.Sensitivity.EVERYTHING, Block.Properties.of(Material.WOOD, umbran_planks.materialColor).noCollission().strength(0.5F).sound(SoundType.WOOD)), "umbran_pressure_plate");
umbran_pressure_plate = registerBlock(new PressurePlateBlock(PressurePlateBlock.Sensitivity.EVERYTHING, AbstractBlock.Properties.of(Material.WOOD, umbran_planks.defaultMaterialColor()).noCollission().strength(0.5F).sound(SoundType.WOOD)), "umbran_pressure_plate");
umbran_button = registerBlock(new WoodButtonBlock(Block.Properties.of(Material.DECORATION).noCollission().strength(0.5F).sound(SoundType.WOOD)), "umbran_button");
hellbark_sapling = registerBlock(new SaplingBlockBOP(new HellbarkTree(), Block.Properties.of(Material.PLANT).noCollission().randomTicks().instabreak().sound(SoundType.GRASS)), "hellbark_sapling");
@ -246,11 +246,11 @@ public class ModBlocks
hellbark_planks = registerBlock(new Block(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_GRAY).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "hellbark_planks");
hellbark_stairs = registerBlock(new StairsBlock(hellbark_planks.defaultBlockState(), Block.Properties.copy(hellbark_planks)), "hellbark_stairs");
hellbark_slab = registerBlock(new SlabBlock(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_GRAY).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "hellbark_slab");
hellbark_fence = registerBlock(new FenceBlock(Block.Properties.of(Material.WOOD, hellbark_planks.materialColor).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "hellbark_fence");
hellbark_fence_gate = registerBlock(new FenceGateBlock(Block.Properties.of(Material.WOOD, hellbark_planks.materialColor).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "hellbark_fence_gate");
hellbark_door = registerBlock(new DoorBlock(Block.Properties.of(Material.WOOD, hellbark_planks.materialColor).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "hellbark_door");
hellbark_fence = registerBlock(new FenceBlock(Block.Properties.of(Material.WOOD, hellbark_planks.defaultMaterialColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "hellbark_fence");
hellbark_fence_gate = registerBlock(new FenceGateBlock(Block.Properties.of(Material.WOOD, hellbark_planks.defaultMaterialColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD)), "hellbark_fence_gate");
hellbark_door = registerBlock(new DoorBlock(Block.Properties.of(Material.WOOD, hellbark_planks.defaultMaterialColor()).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "hellbark_door");
hellbark_trapdoor = registerBlock(new TrapDoorBlock(Block.Properties.of(Material.WOOD, MaterialColor.TERRACOTTA_GRAY).strength(3.0F).sound(SoundType.WOOD).noOcclusion()), "hellbark_trapdoor");
hellbark_pressure_plate = registerBlock(new PressurePlateBlock(PressurePlateBlock.Sensitivity.EVERYTHING, Block.Properties.of(Material.WOOD, hellbark_planks.materialColor).noCollission().strength(0.5F).sound(SoundType.WOOD)), "hellbark_pressure_plate");
hellbark_pressure_plate = registerBlock(new PressurePlateBlock(PressurePlateBlock.Sensitivity.EVERYTHING, Block.Properties.of(Material.WOOD, hellbark_planks.defaultMaterialColor()).noCollission().strength(0.5F).sound(SoundType.WOOD)), "hellbark_pressure_plate");
hellbark_button = registerBlock(new WoodButtonBlock(Block.Properties.of(Material.DECORATION).noCollission().strength(0.5F).sound(SoundType.WOOD)), "hellbark_button");
//Flowers

View File

@ -26,13 +26,13 @@ public class ModConfig
public static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder();
public static final ForgeConfigSpec SPEC;
public static final ForgeConfigSpec.BooleanValue useWorldType;
// TODO: public static final ForgeConfigSpec.BooleanValue useWorldType;
static
{
BUILDER.comment("Client-related options.");
BUILDER.push("gui");
useWorldType = BUILDER.comment("Select the Biomes O' Plenty world type by default.").define("use_world_type", true);
// TODO: useWorldType = BUILDER.comment("Select the Biomes O' Plenty world type by default.").define("use_world_type", true);
BUILDER.pop();
SPEC = BUILDER.build();

View File

@ -7,33 +7,26 @@
******************************************************************************/
package biomesoplenty.init;
import biomesoplenty.api.entity.BOPEntities;
import biomesoplenty.common.entity.item.BoatEntityBOP;
import biomesoplenty.common.entity.item.BoatRendererBOP;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityClassification;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.item.BoatEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.registries.ForgeRegistries;
import static biomesoplenty.core.BiomesOPlenty.MOD_ID;
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
public class ModEntities
{
@SubscribeEvent
public static void registerEntities(RegistryEvent.Register<EntityType<?>> event)
{
BOPEntities.boat_bop = EntityType.Builder.<BoatEntityBOP>of(BoatEntityBOP::new, EntityClassification.MISC).setTrackingRange(80).setUpdateInterval(3).setShouldReceiveVelocityUpdates(true).sized(1.375f, 0.5625f).setCustomClientFactory(BoatEntityBOP::new).build(MOD_ID + ":boat_bop");
BOPEntities.boat_bop.setRegistryName("boat_bop");
ForgeRegistries.ENTITIES.register(BOPEntities.boat_bop);
// BOPEntities.boat_bop = EntityType.Builder.<BoatEntityBOP>of(BoatEntityBOP::new, EntityClassification.MISC).setTrackingRange(80).setUpdateInterval(3).setShouldReceiveVelocityUpdates(true).sized(1.375f, 0.5625f).setCustomClientFactory(BoatEntityBOP::new).build(MOD_ID + ":boat_bop");
// BOPEntities.boat_bop.setRegistryName("boat_bop");
// ForgeRegistries.ENTITIES.register(BOPEntities.boat_bop);
}
public static <T extends Entity> EntityType<T> createEntity(EntityType.IFactory<T> factory, EntityClassification classification, String name, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates)
@ -48,6 +41,6 @@ public class ModEntities
@OnlyIn(Dist.CLIENT)
public static void registerRendering()
{
RenderingRegistry.registerEntityRenderingHandler((EntityType<? extends BoatEntityBOP>)BOPEntities.boat_bop, BoatRendererBOP::new);
// RenderingRegistry.registerEntityRenderingHandler((EntityType<? extends BoatEntityBOP>)BOPEntities.boat_bop, BoatRendererBOP::new);
}
}

View File

@ -7,8 +7,6 @@
******************************************************************************/
package biomesoplenty.init;
import biomesoplenty.common.entity.item.BoatEntityBOP;
import biomesoplenty.common.item.BoatItemBOP;
import biomesoplenty.common.item.MusicDiscItemBOP;
import biomesoplenty.common.util.inventory.ItemGroupBOP;
import net.minecraft.item.Item;
@ -30,17 +28,17 @@ public class ModItems
music_disc_wanderer = registerItem(new MusicDiscItemBOP("music_disc.wanderer"), "music_disc_wanderer");
fir_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.FIR, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "fir_boat");
redwood_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.REDWOOD, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "redwood_boat");
cherry_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.CHERRY, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "cherry_boat");
mahogany_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.MAHOGANY, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "mahogany_boat");
jacaranda_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.JACARANDA, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "jacaranda_boat");
palm_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.PALM, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "palm_boat");
willow_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.WILLOW, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "willow_boat");
dead_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.DEAD, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "dead_boat");
magic_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.MAGIC, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "magic_boat");
umbran_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.UMBRAN, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "umbran_boat");
hellbark_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.HELLBARK, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "hellbark_boat");
// fir_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.FIR, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "fir_boat");
// redwood_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.REDWOOD, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "redwood_boat");
// cherry_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.CHERRY, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "cherry_boat");
// mahogany_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.MAHOGANY, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "mahogany_boat");
// jacaranda_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.JACARANDA, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "jacaranda_boat");
// palm_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.PALM, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "palm_boat");
// willow_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.WILLOW, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "willow_boat");
// dead_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.DEAD, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "dead_boat");
// magic_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.MAGIC, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "magic_boat");
// umbran_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.UMBRAN, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "umbran_boat");
// hellbark_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.HELLBARK, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "hellbark_boat");
bop_icon = registerItem(new Item(new Item.Properties()), "bop_icon");
}

View File

@ -1,3 +1,8 @@
# 1.16
public net.minecraft.block.FireBlock func_180686_a(Lnet/minecraft/block/Block;II)V #setFlammable
public net.minecraft.world.gen.feature.TreeFeature *()
public-f net.minecraft.client.gui.screen.BiomeGeneratorTypeScreens *
# Make various Block related things public
public net.minecraft.block.Block$Properties *()
@ -11,6 +16,8 @@ public net.minecraft.block.TrapDoorBlock <init>(Lnet/minecraft/block/Block$Prope
public net.minecraft.block.WoodButtonBlock <init>(Lnet/minecraft/block/Block$Properties;)V # WoodButtonBlock
public net.minecraft.block.PressurePlateBlock <init>(Lnet/minecraft/block/PressurePlateBlock$Sensitivity;Lnet/minecraft/block/Block$Properties;)V # PressurePlateBlock
public-f net.minecraft.item.AxeItem field_203176_a # BLOCK_STRIPPING_MAP
# Default to BOP world type