Skip to content

Commit

Permalink
CalenderTFC -> CalendarTFC
Browse files Browse the repository at this point in the history
  • Loading branch information
alcatrazEscapee committed Mar 8, 2019
1 parent 78d3ee7 commit 6b7d39a
Show file tree
Hide file tree
Showing 22 changed files with 114 additions and 114 deletions.
5 changes: 2 additions & 3 deletions src/main/java/net/dries007/tfc/CommonEventHandler.java
Expand Up @@ -32,7 +32,7 @@
import net.dries007.tfc.network.PacketCalendarUpdate; import net.dries007.tfc.network.PacketCalendarUpdate;
import net.dries007.tfc.objects.container.CapabilityContainerListener; import net.dries007.tfc.objects.container.CapabilityContainerListener;
import net.dries007.tfc.util.Helpers; import net.dries007.tfc.util.Helpers;
import net.dries007.tfc.world.classic.CalenderTFC; import net.dries007.tfc.world.classic.CalendarTFC;


import static net.dries007.tfc.api.util.TFCConstants.MOD_ID; import static net.dries007.tfc.api.util.TFCConstants.MOD_ID;


Expand Down Expand Up @@ -191,8 +191,7 @@ public static void onWorldLoad(WorldEvent.Load event)
final World world = event.getWorld(); final World world = event.getWorld();
if (world.provider.getDimension() == 0 && !world.isRemote) if (world.provider.getDimension() == 0 && !world.isRemote)
{ {
TerraFirmaCraft.getLog().info("On Load Baby!"); CalendarTFC.CalendarWorldData.onLoad(event.getWorld());
CalenderTFC.CalendarWorldData.onLoad(event.getWorld());
} }
} }
} }
4 changes: 2 additions & 2 deletions src/main/java/net/dries007/tfc/TerraFirmaCraft.java
Expand Up @@ -33,7 +33,7 @@
import net.dries007.tfc.util.FuelManager; import net.dries007.tfc.util.FuelManager;
import net.dries007.tfc.util.OreDictionaryHelper; import net.dries007.tfc.util.OreDictionaryHelper;
import net.dries007.tfc.util.OreSpawnData; import net.dries007.tfc.util.OreSpawnData;
import net.dries007.tfc.world.classic.CalenderTFC; import net.dries007.tfc.world.classic.CalendarTFC;
import net.dries007.tfc.world.classic.WorldTypeTFC; import net.dries007.tfc.world.classic.WorldTypeTFC;
import net.dries007.tfc.world.classic.chunkdata.CapabilityChunkData; import net.dries007.tfc.world.classic.chunkdata.CapabilityChunkData;
import net.dries007.tfc.world.classic.worldgen.*; import net.dries007.tfc.world.classic.worldgen.*;
Expand Down Expand Up @@ -127,7 +127,7 @@ public void preInit(FMLPreInitializationEvent event)
network.registerMessage(new PacketCalendarUpdate.Handler(), PacketCalendarUpdate.class, ++id, Side.CLIENT); network.registerMessage(new PacketCalendarUpdate.Handler(), PacketCalendarUpdate.class, ++id, Side.CLIENT);


EntitiesTFC.preInit(); EntitiesTFC.preInit();
CalenderTFC.preInit(); CalendarTFC.preInit();
OreSpawnData.preInit(event.getModConfigurationDirectory()); OreSpawnData.preInit(event.getModConfigurationDirectory());


CapabilityChunkData.preInit(); CapabilityChunkData.preInit();
Expand Down
Expand Up @@ -13,7 +13,7 @@
import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.ICapabilitySerializable; import net.minecraftforge.common.capabilities.ICapabilitySerializable;


import net.dries007.tfc.world.classic.CalenderTFC; import net.dries007.tfc.world.classic.CalendarTFC;


/** /**
* This is an implementation of ItemHeat that automatically cools down over time * This is an implementation of ItemHeat that automatically cools down over time
Expand Down Expand Up @@ -57,7 +57,7 @@ public ItemHeatHandler() {} // This is here so you can do a custom implementatio
@Override @Override
public float getTemperature() public float getTemperature()
{ {
return CapabilityItemHeat.adjustTemp(temperature, heatCapacity, CalenderTFC.getTotalTime() - lastUpdateTick); return CapabilityItemHeat.adjustTemp(temperature, heatCapacity, CalendarTFC.getTotalTime() - lastUpdateTick);
} }


/** /**
Expand All @@ -69,7 +69,7 @@ public float getTemperature()
public void setTemperature(float temperature) public void setTemperature(float temperature)
{ {
this.temperature = temperature; this.temperature = temperature;
this.lastUpdateTick = CalenderTFC.getTotalTime(); this.lastUpdateTick = CalendarTFC.getTotalTime();
} }


@Override @Override
Expand Down Expand Up @@ -117,7 +117,7 @@ public NBTTagCompound serializeNBT()
} }
else else
{ {
nbt.setLong("ticks", CalenderTFC.getTotalTime()); nbt.setLong("ticks", CalendarTFC.getTotalTime());
} }
return nbt; return nbt;
} }
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/dries007/tfc/client/ClientEvents.java
Expand Up @@ -42,7 +42,7 @@
import net.dries007.tfc.api.util.IRockObject; import net.dries007.tfc.api.util.IRockObject;
import net.dries007.tfc.client.render.RenderFallingBlockTFC; import net.dries007.tfc.client.render.RenderFallingBlockTFC;
import net.dries007.tfc.objects.entity.EntityFallingBlockTFC; import net.dries007.tfc.objects.entity.EntityFallingBlockTFC;
import net.dries007.tfc.world.classic.CalenderTFC; import net.dries007.tfc.world.classic.CalendarTFC;
import net.dries007.tfc.world.classic.ClimateRenderHelper; import net.dries007.tfc.world.classic.ClimateRenderHelper;
import net.dries007.tfc.world.classic.ClimateTFC; import net.dries007.tfc.world.classic.ClimateTFC;
import net.dries007.tfc.world.classic.chunkdata.ChunkDataProvider; import net.dries007.tfc.world.classic.chunkdata.ChunkDataProvider;
Expand Down Expand Up @@ -99,7 +99,7 @@ public static void onRenderGameOverlayText(RenderGameOverlayEvent.Text event)
WHITE, data.getAverageTemp(), GRAY, WHITE, data.getAverageTemp(), GRAY,
WHITE, ClimateRenderHelper.get(blockpos).getTemperature(), GRAY, WHITE, ClimateRenderHelper.get(blockpos).getTemperature(), GRAY,
WHITE, ClimateTFC.getHeightAdjustedTemp(mc.world, blockpos))); WHITE, ClimateTFC.getHeightAdjustedTemp(mc.world, blockpos)));
list.add(CalenderTFC.getTimeAndDate()); list.add(CalendarTFC.getTimeAndDate());


list.add(GRAY + "Biome: " + WHITE + mc.world.getBiome(blockpos).getBiomeName()); list.add(GRAY + "Biome: " + WHITE + mc.world.getBiome(blockpos).getBiomeName());


Expand Down
21 changes: 13 additions & 8 deletions src/main/java/net/dries007/tfc/cmd/CommandTimeTFC.java
@@ -1,3 +1,8 @@
/*
* Work under Copyright. Licensed under the EUPL.
* See the project README.md and LICENSE.txt for more information.
*/

package net.dries007.tfc.cmd; package net.dries007.tfc.cmd;


import javax.annotation.ParametersAreNonnullByDefault; import javax.annotation.ParametersAreNonnullByDefault;
Expand All @@ -11,7 +16,7 @@


import mcp.MethodsReturnNonnullByDefault; import mcp.MethodsReturnNonnullByDefault;
import net.dries007.tfc.TerraFirmaCraft; import net.dries007.tfc.TerraFirmaCraft;
import net.dries007.tfc.world.classic.CalenderTFC; import net.dries007.tfc.world.classic.CalendarTFC;


@ParametersAreNonnullByDefault @ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault @MethodsReturnNonnullByDefault
Expand All @@ -35,23 +40,23 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args
TerraFirmaCraft.getLog().info("Executing command TFC"); TerraFirmaCraft.getLog().info("Executing command TFC");
if (args.length != 3) throw new WrongUsageException("Requires three arguments"); if (args.length != 3) throw new WrongUsageException("Requires three arguments");


long time = CalenderTFC.TICKS_IN_DAY; long time = CalendarTFC.TICKS_IN_DAY;
switch (args[1].toLowerCase()) switch (args[1].toLowerCase())
{ {
case "month": case "month":
time *= CalenderTFC.getDaysInMonth(); time *= CalendarTFC.getDaysInMonth();
time *= parseInt(args[2], 0, 12 * 1000); time *= parseInt(args[2], 0, 12 * 1000);
break; break;
case "year": case "year":
time *= CalenderTFC.getDaysInMonth() * 12; time *= CalendarTFC.getDaysInMonth() * 12;
time *= parseInt(args[2], 0, 1000); time *= parseInt(args[2], 0, 1000);
break; break;
case "day": case "day":
time *= parseInt(args[2], 0, CalenderTFC.getDaysInMonth() * 12 * 1000); time *= parseInt(args[2], 0, CalendarTFC.getDaysInMonth() * 12 * 1000);
break; break;
case "monthlength": case "monthlength":
int value = parseInt(args[2], 1, 1000); int value = parseInt(args[2], 1, 1000);
CalenderTFC.setMonthLength(server.getEntityWorld(), value); CalendarTFC.setMonthLength(server.getEntityWorld(), value);
sender.sendMessage(new TextComponentString("Set Month Length to " + value)); sender.sendMessage(new TextComponentString("Set Month Length to " + value));
return; return;
default: default:
Expand All @@ -60,14 +65,14 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args


if (args[0].equals("add")) if (args[0].equals("add"))
{ {
time += CalenderTFC.getCalendarTime(); time += CalendarTFC.getCalendarTime();
} }
else if (!args[0].equals("set")) else if (!args[0].equals("set"))
{ {
throw new WrongUsageException("First argument must be [add|set]"); throw new WrongUsageException("First argument must be [add|set]");
} }


CalenderTFC.setCalendarTime(server.getEntityWorld(), time); CalendarTFC.setCalendarTime(server.getEntityWorld(), time);
sender.sendMessage(new TextComponentString("Set Calendar Time to: " + time)); sender.sendMessage(new TextComponentString("Set Calendar Time to: " + time));
} }
} }
Expand Up @@ -12,7 +12,7 @@


import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import net.dries007.tfc.TerraFirmaCraft; import net.dries007.tfc.TerraFirmaCraft;
import net.dries007.tfc.world.classic.CalenderTFC; import net.dries007.tfc.world.classic.CalendarTFC;


public class PacketCalendarUpdate implements IMessage public class PacketCalendarUpdate implements IMessage
{ {
Expand Down Expand Up @@ -51,7 +51,7 @@ public IMessage onMessage(PacketCalendarUpdate message, MessageContext ctx)
if (world != null) if (world != null)
{ {
TerraFirmaCraft.getProxy().getThreadListener(ctx).addScheduledTask(() -> { TerraFirmaCraft.getProxy().getThreadListener(ctx).addScheduledTask(() -> {
CalenderTFC.CalendarWorldData.update(world, message.calendarOffset, message.daysInMonth); CalendarTFC.CalendarWorldData.update(world, message.calendarOffset, message.daysInMonth);
}); });
} }
return null; return null;
Expand Down
Expand Up @@ -34,7 +34,7 @@
import net.dries007.tfc.api.capability.size.Weight; import net.dries007.tfc.api.capability.size.Weight;
import net.dries007.tfc.api.types.Plant; import net.dries007.tfc.api.types.Plant;
import net.dries007.tfc.objects.blocks.BlocksTFC; import net.dries007.tfc.objects.blocks.BlocksTFC;
import net.dries007.tfc.world.classic.CalenderTFC; import net.dries007.tfc.world.classic.CalendarTFC;
import net.dries007.tfc.world.classic.ClimateTFC; import net.dries007.tfc.world.classic.ClimateTFC;
import net.dries007.tfc.world.classic.chunkdata.ChunkDataTFC; import net.dries007.tfc.world.classic.chunkdata.ChunkDataTFC;


Expand All @@ -57,7 +57,7 @@ public BlockCactusTFC(Plant plant)


setSoundType(SoundType.GROUND); setSoundType(SoundType.GROUND);
setHardness(0.25F); setHardness(0.25F);
this.setDefaultState(this.blockState.getBaseState().withProperty(GROWTHSTAGE, CalenderTFC.Month.MARCH.id()).withProperty(PART, EnumBlockPart.SINGLE)); this.setDefaultState(this.blockState.getBaseState().withProperty(GROWTHSTAGE, CalendarTFC.Month.MARCH.id()).withProperty(PART, EnumBlockPart.SINGLE));
} }


@Override @Override
Expand All @@ -78,7 +78,7 @@ public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, IBlockSt
public void grow(World worldIn, Random rand, BlockPos pos, IBlockState state) public void grow(World worldIn, Random rand, BlockPos pos, IBlockState state)
{ {
worldIn.setBlockState(pos.up(), this.getDefaultState()); worldIn.setBlockState(pos.up(), this.getDefaultState());
IBlockState iblockstate = state.withProperty(DAYPERIOD, getCurrentTime(worldIn)).withProperty(AGE, 0).withProperty(GROWTHSTAGE, CalenderTFC.getMonthOfYear().id()).withProperty(PART, getPlantPart(worldIn, pos)); IBlockState iblockstate = state.withProperty(DAYPERIOD, getCurrentTime(worldIn)).withProperty(AGE, 0).withProperty(GROWTHSTAGE, CalendarTFC.getMonthOfYear().id()).withProperty(PART, getPlantPart(worldIn, pos));
worldIn.setBlockState(pos, iblockstate); worldIn.setBlockState(pos, iblockstate);
iblockstate.neighborChanged(worldIn, pos.up(), this, pos); iblockstate.neighborChanged(worldIn, pos.up(), this, pos);
} }
Expand Down Expand Up @@ -106,7 +106,7 @@ public int getMetaFromState(IBlockState state)
@Nonnull @Nonnull
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
{ {
return state.withProperty(GROWTHSTAGE, CalenderTFC.getMonthOfYear().id()).withProperty(PART, getPlantPart(worldIn, pos)); return state.withProperty(GROWTHSTAGE, CalendarTFC.getMonthOfYear().id()).withProperty(PART, getPlantPart(worldIn, pos));
} }


@Override @Override
Expand All @@ -127,7 +127,7 @@ public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, Bloc
@Nonnull @Nonnull
public IBlockState getStateFromMeta(int meta) public IBlockState getStateFromMeta(int meta)
{ {
return this.getDefaultState().withProperty(AGE, meta).withProperty(GROWTHSTAGE, CalenderTFC.getMonthOfYear().id()); return this.getDefaultState().withProperty(AGE, meta).withProperty(GROWTHSTAGE, CalendarTFC.getMonthOfYear().id());
} }


@Override @Override
Expand All @@ -141,7 +141,7 @@ public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random ra
{ {
if (!worldIn.isAreaLoaded(pos, 1)) return; if (!worldIn.isAreaLoaded(pos, 1)) return;
int currentStage = state.getValue(GROWTHSTAGE); int currentStage = state.getValue(GROWTHSTAGE);
int expectedStage = CalenderTFC.getMonthOfYear().id(); int expectedStage = CalendarTFC.getMonthOfYear().id();
int currentTime = state.getValue(DAYPERIOD); int currentTime = state.getValue(DAYPERIOD);
int expectedTime = getCurrentTime(worldIn); int expectedTime = getCurrentTime(worldIn);


Expand Down
Expand Up @@ -28,7 +28,7 @@
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;


import net.dries007.tfc.api.types.Plant; import net.dries007.tfc.api.types.Plant;
import net.dries007.tfc.world.classic.CalenderTFC; import net.dries007.tfc.world.classic.CalendarTFC;
import net.dries007.tfc.world.classic.ClimateTFC; import net.dries007.tfc.world.classic.ClimateTFC;
import net.dries007.tfc.world.classic.chunkdata.ChunkDataTFC; import net.dries007.tfc.world.classic.chunkdata.ChunkDataTFC;


Expand Down Expand Up @@ -62,7 +62,7 @@ public BlockCreepingPlantTFC(Plant plant)
super(plant); super(plant);
if (MAP.put(plant, this) != null) throw new IllegalStateException("There can only be one."); if (MAP.put(plant, this) != null) throw new IllegalStateException("There can only be one.");


this.setDefaultState(this.blockState.getBaseState().withProperty(GROWTHSTAGE, CalenderTFC.Month.MARCH.id()).withProperty(DOWN, false).withProperty(UP, false).withProperty(NORTH, false).withProperty(EAST, false).withProperty(SOUTH, false).withProperty(WEST, false)); this.setDefaultState(this.blockState.getBaseState().withProperty(GROWTHSTAGE, CalendarTFC.Month.MARCH.id()).withProperty(DOWN, false).withProperty(UP, false).withProperty(NORTH, false).withProperty(EAST, false).withProperty(SOUTH, false).withProperty(WEST, false));
} }


public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos, EnumFacing facing) public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos, EnumFacing facing)
Expand All @@ -83,7 +83,7 @@ public int getMetaFromState(IBlockState state)
@Nonnull @Nonnull
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
{ {
return state.withProperty(GROWTHSTAGE, CalenderTFC.getMonthOfYear().id()) return state.withProperty(GROWTHSTAGE, CalendarTFC.getMonthOfYear().id())
.withProperty(DOWN, canPlantConnectTo(worldIn, pos, EnumFacing.DOWN)) .withProperty(DOWN, canPlantConnectTo(worldIn, pos, EnumFacing.DOWN))
.withProperty(UP, canPlantConnectTo(worldIn, pos, EnumFacing.UP)) .withProperty(UP, canPlantConnectTo(worldIn, pos, EnumFacing.UP))
.withProperty(NORTH, canPlantConnectTo(worldIn, pos, EnumFacing.NORTH)) .withProperty(NORTH, canPlantConnectTo(worldIn, pos, EnumFacing.NORTH))
Expand Down Expand Up @@ -182,13 +182,13 @@ public IBlockState withRotation(IBlockState state, Rotation rot)
switch (rot) switch (rot)
{ {
case CLOCKWISE_180: case CLOCKWISE_180:
return state.withProperty(GROWTHSTAGE, CalenderTFC.getMonthOfYear().id()).withProperty(NORTH, state.getValue(SOUTH)).withProperty(EAST, state.getValue(WEST)).withProperty(SOUTH, state.getValue(NORTH)).withProperty(WEST, state.getValue(EAST)); return state.withProperty(GROWTHSTAGE, CalendarTFC.getMonthOfYear().id()).withProperty(NORTH, state.getValue(SOUTH)).withProperty(EAST, state.getValue(WEST)).withProperty(SOUTH, state.getValue(NORTH)).withProperty(WEST, state.getValue(EAST));
case COUNTERCLOCKWISE_90: case COUNTERCLOCKWISE_90:
return state.withProperty(GROWTHSTAGE, CalenderTFC.getMonthOfYear().id()).withProperty(NORTH, state.getValue(EAST)).withProperty(EAST, state.getValue(SOUTH)).withProperty(SOUTH, state.getValue(WEST)).withProperty(WEST, state.getValue(NORTH)); return state.withProperty(GROWTHSTAGE, CalendarTFC.getMonthOfYear().id()).withProperty(NORTH, state.getValue(EAST)).withProperty(EAST, state.getValue(SOUTH)).withProperty(SOUTH, state.getValue(WEST)).withProperty(WEST, state.getValue(NORTH));
case CLOCKWISE_90: case CLOCKWISE_90:
return state.withProperty(GROWTHSTAGE, CalenderTFC.getMonthOfYear().id()).withProperty(NORTH, state.getValue(WEST)).withProperty(EAST, state.getValue(NORTH)).withProperty(SOUTH, state.getValue(EAST)).withProperty(WEST, state.getValue(SOUTH)); return state.withProperty(GROWTHSTAGE, CalendarTFC.getMonthOfYear().id()).withProperty(NORTH, state.getValue(WEST)).withProperty(EAST, state.getValue(NORTH)).withProperty(SOUTH, state.getValue(EAST)).withProperty(WEST, state.getValue(SOUTH));
default: default:
return state.withProperty(GROWTHSTAGE, CalenderTFC.getMonthOfYear().id()); return state.withProperty(GROWTHSTAGE, CalendarTFC.getMonthOfYear().id());
} }
} }


Expand All @@ -200,9 +200,9 @@ public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
switch (mirrorIn) switch (mirrorIn)
{ {
case LEFT_RIGHT: case LEFT_RIGHT:
return state.withProperty(GROWTHSTAGE, CalenderTFC.getMonthOfYear().id()).withProperty(NORTH, state.getValue(SOUTH)).withProperty(SOUTH, state.getValue(NORTH)); return state.withProperty(GROWTHSTAGE, CalendarTFC.getMonthOfYear().id()).withProperty(NORTH, state.getValue(SOUTH)).withProperty(SOUTH, state.getValue(NORTH));
case FRONT_BACK: case FRONT_BACK:
return state.withProperty(GROWTHSTAGE, CalenderTFC.getMonthOfYear().id()).withProperty(EAST, state.getValue(WEST)).withProperty(WEST, state.getValue(EAST)); return state.withProperty(GROWTHSTAGE, CalendarTFC.getMonthOfYear().id()).withProperty(EAST, state.getValue(WEST)).withProperty(WEST, state.getValue(EAST));
default: default:
return super.withMirror(state, mirrorIn); return super.withMirror(state, mirrorIn);
} }
Expand Down
Expand Up @@ -24,7 +24,7 @@
import net.minecraft.world.World; import net.minecraft.world.World;


import net.dries007.tfc.api.types.Plant; import net.dries007.tfc.api.types.Plant;
import net.dries007.tfc.world.classic.CalenderTFC; import net.dries007.tfc.world.classic.CalendarTFC;
import net.dries007.tfc.world.classic.ClimateTFC; import net.dries007.tfc.world.classic.ClimateTFC;
import net.dries007.tfc.world.classic.chunkdata.ChunkDataTFC; import net.dries007.tfc.world.classic.chunkdata.ChunkDataTFC;


Expand All @@ -45,7 +45,7 @@ public BlockDoublePlantTFC(Plant plant)
super(plant); super(plant);
if (MAP.put(plant, this) != null) throw new IllegalStateException("There can only be one."); if (MAP.put(plant, this) != null) throw new IllegalStateException("There can only be one.");


this.setDefaultState(this.blockState.getBaseState().withProperty(GROWTHSTAGE, CalenderTFC.Month.MARCH.id()).withProperty(PART, EnumBlockPart.SINGLE)); this.setDefaultState(this.blockState.getBaseState().withProperty(GROWTHSTAGE, CalendarTFC.Month.MARCH.id()).withProperty(PART, EnumBlockPart.SINGLE));
} }


@Override @Override
Expand All @@ -66,7 +66,7 @@ public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, IBlockSt
public void grow(World worldIn, Random rand, BlockPos pos, IBlockState state) public void grow(World worldIn, Random rand, BlockPos pos, IBlockState state)
{ {
worldIn.setBlockState(pos.up(), this.getDefaultState()); worldIn.setBlockState(pos.up(), this.getDefaultState());
IBlockState iblockstate = state.withProperty(AGE, 0).withProperty(GROWTHSTAGE, CalenderTFC.getMonthOfYear().id()).withProperty(PART, getPlantPart(worldIn, pos)); IBlockState iblockstate = state.withProperty(AGE, 0).withProperty(GROWTHSTAGE, CalendarTFC.getMonthOfYear().id()).withProperty(PART, getPlantPart(worldIn, pos));
worldIn.setBlockState(pos, iblockstate); worldIn.setBlockState(pos, iblockstate);
iblockstate.neighborChanged(worldIn, pos.up(), this, pos); iblockstate.neighborChanged(worldIn, pos.up(), this, pos);
} }
Expand Down Expand Up @@ -139,7 +139,7 @@ public int getMetaFromState(IBlockState state)
@Nonnull @Nonnull
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
{ {
return state.withProperty(GROWTHSTAGE, CalenderTFC.getMonthOfYear().id()).withProperty(PART, getPlantPart(worldIn, pos)); return state.withProperty(GROWTHSTAGE, CalendarTFC.getMonthOfYear().id()).withProperty(PART, getPlantPart(worldIn, pos));
} }


@Override @Override
Expand All @@ -160,15 +160,15 @@ public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, Bloc
@Nonnull @Nonnull
public IBlockState getStateFromMeta(int meta) public IBlockState getStateFromMeta(int meta)
{ {
return this.getDefaultState().withProperty(AGE, meta).withProperty(GROWTHSTAGE, CalenderTFC.getMonthOfYear().id()); return this.getDefaultState().withProperty(AGE, meta).withProperty(GROWTHSTAGE, CalendarTFC.getMonthOfYear().id());
} }


@Override @Override
public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random random) public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random random)
{ {
if (!worldIn.isAreaLoaded(pos, 1)) return; if (!worldIn.isAreaLoaded(pos, 1)) return;
int currentStage = state.getValue(GROWTHSTAGE); int currentStage = state.getValue(GROWTHSTAGE);
int expectedStage = CalenderTFC.getMonthOfYear().id(); int expectedStage = CalendarTFC.getMonthOfYear().id();
int currentTime = state.getValue(DAYPERIOD); int currentTime = state.getValue(DAYPERIOD);
int expectedTime = getCurrentTime(worldIn); int expectedTime = getCurrentTime(worldIn);


Expand Down
Expand Up @@ -27,7 +27,7 @@


import net.dries007.tfc.api.types.Plant; import net.dries007.tfc.api.types.Plant;
import net.dries007.tfc.objects.blocks.BlocksTFC; import net.dries007.tfc.objects.blocks.BlocksTFC;
import net.dries007.tfc.world.classic.CalenderTFC; import net.dries007.tfc.world.classic.CalendarTFC;


import static net.dries007.tfc.world.classic.ChunkGenTFC.FRESH_WATER; import static net.dries007.tfc.world.classic.ChunkGenTFC.FRESH_WATER;


Expand All @@ -47,7 +47,7 @@ public BlockFloatingWaterTFC(Plant plant)
super(plant); super(plant);
if (MAP.put(plant, this) != null) throw new IllegalStateException("There can only be one."); if (MAP.put(plant, this) != null) throw new IllegalStateException("There can only be one.");


this.setDefaultState(this.blockState.getBaseState().withProperty(GROWTHSTAGE, CalenderTFC.Month.MARCH.id())); this.setDefaultState(this.blockState.getBaseState().withProperty(GROWTHSTAGE, CalendarTFC.Month.MARCH.id()));
} }


@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
Expand All @@ -71,13 +71,13 @@ public void onEntityCollision(World worldIn, BlockPos pos, IBlockState state, En
@Nonnull @Nonnull
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
{ {
return state.withProperty(GROWTHSTAGE, CalenderTFC.getMonthOfYear().id()); return state.withProperty(GROWTHSTAGE, CalendarTFC.getMonthOfYear().id());
} }


@Override @Override
public void onBlockAdded(World world, BlockPos pos, IBlockState state) public void onBlockAdded(World world, BlockPos pos, IBlockState state)
{ {
world.setBlockState(pos, this.blockState.getBaseState().withProperty(DAYPERIOD, getCurrentTime(world)).withProperty(GROWTHSTAGE, CalenderTFC.getMonthOfYear().id())); world.setBlockState(pos, this.blockState.getBaseState().withProperty(DAYPERIOD, getCurrentTime(world)).withProperty(GROWTHSTAGE, CalendarTFC.getMonthOfYear().id()));
this.checkAndDropBlock(world, pos, state); this.checkAndDropBlock(world, pos, state);
} }


Expand Down

0 comments on commit 6b7d39a

Please sign in to comment.