Skip to content
Permalink
Browse files

CalenderTFC -> CalendarTFC

  • Loading branch information
alcatrazEscapee committed Mar 8, 2019
1 parent 78d3ee7 commit 6b7d39a4fdd18316d6c92df94a131f8a5e9815d0
Showing with 114 additions and 114 deletions.
  1. +2 −3 src/main/java/net/dries007/tfc/CommonEventHandler.java
  2. +2 −2 src/main/java/net/dries007/tfc/TerraFirmaCraft.java
  3. +4 −4 src/main/java/net/dries007/tfc/api/capability/heat/ItemHeatHandler.java
  4. +2 −2 src/main/java/net/dries007/tfc/client/ClientEvents.java
  5. +13 −8 src/main/java/net/dries007/tfc/cmd/CommandTimeTFC.java
  6. +2 −2 src/main/java/net/dries007/tfc/network/PacketCalendarUpdate.java
  7. +6 −6 src/main/java/net/dries007/tfc/objects/blocks/plants/BlockCactusTFC.java
  8. +9 −9 src/main/java/net/dries007/tfc/objects/blocks/plants/BlockCreepingPlantTFC.java
  9. +6 −6 src/main/java/net/dries007/tfc/objects/blocks/plants/BlockDoublePlantTFC.java
  10. +4 −4 src/main/java/net/dries007/tfc/objects/blocks/plants/BlockFloatingWaterTFC.java
  11. +6 −6 src/main/java/net/dries007/tfc/objects/blocks/plants/BlockPlantTFC.java
  12. +3 −3 src/main/java/net/dries007/tfc/objects/blocks/plants/BlockShortGrassTFC.java
  13. +3 −3 src/main/java/net/dries007/tfc/objects/blocks/plants/BlockStackPlantTFC.java
  14. +3 −3 src/main/java/net/dries007/tfc/objects/blocks/plants/BlockTallGrassTFC.java
  15. +2 −2 src/main/java/net/dries007/tfc/objects/blocks/wood/BlockSaplingTFC.java
  16. +2 −2 src/main/java/net/dries007/tfc/objects/items/ceramics/ItemMold.java
  17. +4 −4 src/main/java/net/dries007/tfc/objects/items/ceramics/ItemSmallVessel.java
  18. +3 −3 src/main/java/net/dries007/tfc/objects/te/TESaplingTFC.java
  19. +4 −4 src/main/java/net/dries007/tfc/objects/te/TETorchTFC.java
  20. +21 −25 src/main/java/net/dries007/tfc/world/classic/{CalenderTFC.java → CalendarTFC.java}
  21. +2 −2 src/main/java/net/dries007/tfc/world/classic/ChunkGenTFC.java
  22. +11 −11 src/main/java/net/dries007/tfc/world/classic/ClimateTFC.java
@@ -32,7 +32,7 @@
import net.dries007.tfc.network.PacketCalendarUpdate;
import net.dries007.tfc.objects.container.CapabilityContainerListener;
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;

@@ -191,8 +191,7 @@ public static void onWorldLoad(WorldEvent.Load event)
final World world = event.getWorld();
if (world.provider.getDimension() == 0 && !world.isRemote)
{
TerraFirmaCraft.getLog().info("On Load Baby!");
CalenderTFC.CalendarWorldData.onLoad(event.getWorld());
CalendarTFC.CalendarWorldData.onLoad(event.getWorld());
}
}
}
@@ -33,7 +33,7 @@
import net.dries007.tfc.util.FuelManager;
import net.dries007.tfc.util.OreDictionaryHelper;
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.chunkdata.CapabilityChunkData;
import net.dries007.tfc.world.classic.worldgen.*;
@@ -127,7 +127,7 @@ public void preInit(FMLPreInitializationEvent event)
network.registerMessage(new PacketCalendarUpdate.Handler(), PacketCalendarUpdate.class, ++id, Side.CLIENT);

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

CapabilityChunkData.preInit();
@@ -13,7 +13,7 @@
import net.minecraftforge.common.capabilities.Capability;
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
@@ -57,7 +57,7 @@ public ItemHeatHandler() {} // This is here so you can do a custom implementatio
@Override
public float getTemperature()
{
return CapabilityItemHeat.adjustTemp(temperature, heatCapacity, CalenderTFC.getTotalTime() - lastUpdateTick);
return CapabilityItemHeat.adjustTemp(temperature, heatCapacity, CalendarTFC.getTotalTime() - lastUpdateTick);
}

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

@Override
@@ -117,7 +117,7 @@ public NBTTagCompound serializeNBT()
}
else
{
nbt.setLong("ticks", CalenderTFC.getTotalTime());
nbt.setLong("ticks", CalendarTFC.getTotalTime());
}
return nbt;
}
@@ -42,7 +42,7 @@
import net.dries007.tfc.api.util.IRockObject;
import net.dries007.tfc.client.render.RenderFallingBlockTFC;
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.ClimateTFC;
import net.dries007.tfc.world.classic.chunkdata.ChunkDataProvider;
@@ -99,7 +99,7 @@ public static void onRenderGameOverlayText(RenderGameOverlayEvent.Text event)
WHITE, data.getAverageTemp(), GRAY,
WHITE, ClimateRenderHelper.get(blockpos).getTemperature(), GRAY,
WHITE, ClimateTFC.getHeightAdjustedTemp(mc.world, blockpos)));
list.add(CalenderTFC.getTimeAndDate());
list.add(CalendarTFC.getTimeAndDate());

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

@@ -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;

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

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

@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
@@ -35,23 +40,23 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args
TerraFirmaCraft.getLog().info("Executing command TFC");
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())
{
case "month":
time *= CalenderTFC.getDaysInMonth();
time *= CalendarTFC.getDaysInMonth();
time *= parseInt(args[2], 0, 12 * 1000);
break;
case "year":
time *= CalenderTFC.getDaysInMonth() * 12;
time *= CalendarTFC.getDaysInMonth() * 12;
time *= parseInt(args[2], 0, 1000);
break;
case "day":
time *= parseInt(args[2], 0, CalenderTFC.getDaysInMonth() * 12 * 1000);
time *= parseInt(args[2], 0, CalendarTFC.getDaysInMonth() * 12 * 1000);
break;
case "monthlength":
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));
return;
default:
@@ -60,14 +65,14 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args

if (args[0].equals("add"))
{
time += CalenderTFC.getCalendarTime();
time += CalendarTFC.getCalendarTime();
}
else if (!args[0].equals("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));
}
}
@@ -12,7 +12,7 @@

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

public class PacketCalendarUpdate implements IMessage
{
@@ -51,7 +51,7 @@ public IMessage onMessage(PacketCalendarUpdate message, MessageContext ctx)
if (world != null)
{
TerraFirmaCraft.getProxy().getThreadListener(ctx).addScheduledTask(() -> {
CalenderTFC.CalendarWorldData.update(world, message.calendarOffset, message.daysInMonth);
CalendarTFC.CalendarWorldData.update(world, message.calendarOffset, message.daysInMonth);
});
}
return null;
@@ -34,7 +34,7 @@
import net.dries007.tfc.api.capability.size.Weight;
import net.dries007.tfc.api.types.Plant;
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.chunkdata.ChunkDataTFC;

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

setSoundType(SoundType.GROUND);
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
@@ -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)
{
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);
iblockstate.neighborChanged(worldIn, pos.up(), this, pos);
}
@@ -106,7 +106,7 @@ public int getMetaFromState(IBlockState state)
@Nonnull
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
@@ -127,7 +127,7 @@ public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, Bloc
@Nonnull
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
@@ -141,7 +141,7 @@ public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random ra
{
if (!worldIn.isAreaLoaded(pos, 1)) return;
int currentStage = state.getValue(GROWTHSTAGE);
int expectedStage = CalenderTFC.getMonthOfYear().id();
int expectedStage = CalendarTFC.getMonthOfYear().id();
int currentTime = state.getValue(DAYPERIOD);
int expectedTime = getCurrentTime(worldIn);

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

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.chunkdata.ChunkDataTFC;

@@ -62,7 +62,7 @@ public BlockCreepingPlantTFC(Plant plant)
super(plant);
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)
@@ -83,7 +83,7 @@ public int getMetaFromState(IBlockState state)
@Nonnull
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(UP, canPlantConnectTo(worldIn, pos, EnumFacing.UP))
.withProperty(NORTH, canPlantConnectTo(worldIn, pos, EnumFacing.NORTH))
@@ -182,13 +182,13 @@ public IBlockState withRotation(IBlockState state, Rotation rot)
switch (rot)
{
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:
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:
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:
return state.withProperty(GROWTHSTAGE, CalenderTFC.getMonthOfYear().id());
return state.withProperty(GROWTHSTAGE, CalendarTFC.getMonthOfYear().id());
}
}

@@ -200,9 +200,9 @@ public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
switch (mirrorIn)
{
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:
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:
return super.withMirror(state, mirrorIn);
}
@@ -24,7 +24,7 @@
import net.minecraft.world.World;

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.chunkdata.ChunkDataTFC;

@@ -45,7 +45,7 @@ public BlockDoublePlantTFC(Plant plant)
super(plant);
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
@@ -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)
{
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);
iblockstate.neighborChanged(worldIn, pos.up(), this, pos);
}
@@ -139,7 +139,7 @@ public int getMetaFromState(IBlockState state)
@Nonnull
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
@@ -160,15 +160,15 @@ public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, Bloc
@Nonnull
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
public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random random)
{
if (!worldIn.isAreaLoaded(pos, 1)) return;
int currentStage = state.getValue(GROWTHSTAGE);
int expectedStage = CalenderTFC.getMonthOfYear().id();
int expectedStage = CalendarTFC.getMonthOfYear().id();
int currentTime = state.getValue(DAYPERIOD);
int expectedTime = getCurrentTime(worldIn);

@@ -27,7 +27,7 @@

import net.dries007.tfc.api.types.Plant;
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;

@@ -47,7 +47,7 @@ public BlockFloatingWaterTFC(Plant plant)
super(plant);
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")
@@ -71,13 +71,13 @@ public void onEntityCollision(World worldIn, BlockPos pos, IBlockState state, En
@Nonnull
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
{
return state.withProperty(GROWTHSTAGE, CalenderTFC.getMonthOfYear().id());
return state.withProperty(GROWTHSTAGE, CalendarTFC.getMonthOfYear().id());
}

@Override
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);
}

0 comments on commit 6b7d39a

Please sign in to comment.
You can’t perform that action at this time.