Skip to content

Commit

Permalink
Fix fluid overlay and item elevator, cleanup for 1.12.2
Browse files Browse the repository at this point in the history
  • Loading branch information
falkreon committed Dec 2, 2017
1 parent a5c91da commit 463772f
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 155 deletions.
8 changes: 5 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ apply plugin: 'net.minecraftforge.gradle.forge'

group = "com.elytradev"
archivesBaseName = "ThermionicsWorld"
version = "MC1.12.1_ver1.0"
version = "MC1.12.2_ver1.0"

sourceCompatibility = 1.8
targetCompatibility = 1.8

minecraft {
version = '1.12.1-14.22.0.2446'
mappings = 'snapshot_20170817'
//version = '1.12.1-14.22.0.2446'
//mappings = 'snapshot_20170817'
version = '1.12.2-14.23.1.2559'
mappings = 'snapshot_20171202'

runDir = "minecraft"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,74 +24,50 @@
package com.elytradev.thermionics.world;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;

import com.elytradev.thermionics.world.block.BlockShrubBone;
import com.elytradev.thermionics.world.block.BlockFluidSimple;
import com.elytradev.thermionics.world.block.BlockGemrock;
import com.elytradev.thermionics.world.block.BlockMeat;
import com.elytradev.thermionics.world.block.BlockMeatEdible;
import com.elytradev.thermionics.world.block.BlockNorfairite;
import com.elytradev.thermionics.world.block.EnumEdibleMeat;
import com.elytradev.thermionics.world.block.TWBlocks;
import com.elytradev.thermionics.world.gen.WorldProviderNeoHell;
import com.elytradev.thermionics.world.gen.biome.BiomeRegistry;
import com.elytradev.thermionics.world.gen.biome.NeoBiome;
import com.elytradev.thermionics.world.item.ItemBlockColored;
import com.elytradev.thermionics.world.item.ItemBlockEquivalentState;
import com.elytradev.thermionics.world.item.ItemBlockGemrock;
import com.elytradev.thermionics.world.item.ItemBlockMeatEdible;
import com.elytradev.thermionics.world.item.TWItems;
import com.google.common.collect.ImmutableList;

import net.minecraft.block.Block;
import net.minecraft.block.BlockColored;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.MaterialLiquid;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.item.crafting.ShapedRecipes;
import net.minecraft.item.crafting.ShapelessRecipes;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.DimensionType;
import net.minecraft.world.World;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.event.entity.living.LivingFallEvent;
import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent;
import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.Event;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.oredict.OreDictionary;
Expand Down Expand Up @@ -485,7 +461,7 @@ public void renderGameOverlayEvent(RenderGameOverlayEvent.Text event) {

@SubscribeEvent
public void cropGrowEvent(BlockEvent.CropGrowEvent.Pre event) {
IBlockState cropState = event.getState();
//IBlockState cropState = event.getState();
Block land = event.getWorld().getBlockState(event.getPos().down()).getBlock();
if (land instanceof BlockMeat) {
//vanilla ticks give a 1 in 10 chance. We're forcing it on a 1 in 4, with the remaining 3 potentially ALSO
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,31 @@

import javax.annotation.Nonnull;

import com.elytradev.thermionics.world.ThermionicsWorld;

import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.material.MaterialLiquid;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.item.EntityBoat;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.monster.EntityGhast;
import net.minecraft.entity.monster.EntityMagmaCube;
import net.minecraft.entity.monster.EntityPigZombie;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.DamageSource;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidBase;
import net.minecraftforge.fluids.BlockFluidFinite;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class BlockFluidSimple extends BlockFluidFinite {

public static final int SCALDING = 322; //322 degrees kelvin is about 120 degrees fahrenheit; scalding temperature.

private DamageSource fluidDamage;
private boolean liftsItems = false;
private float damageAmount = 0.0f;
//private float damageAmount = 0.0f;

public BlockFluidSimple(Fluid fluid, String name) {
super(fluid,
Expand All @@ -70,11 +67,17 @@ public BlockFluidSimple(Fluid fluid, String name) {
this.setUnlocalizedName("thermionics_world.fluid."+name);

this.fluidDamage = new DamageSource("fluid."+fluid.getName()).setDamageBypassesArmor().setDamageIsAbsolute();
if (fluid.getTemperature() > SCALDING) damageAmount = 1 + (fluid.getTemperature() - SCALDING) / 20f;
//if (fluid.getTemperature() > SCALDING) damageAmount = 1 + (fluid.getTemperature() - SCALDING) / 20f;

this.setDefaultState(blockState.getBaseState().withProperty(BlockFluidBase.LEVEL, 3));
}

@Override
@SideOnly(Side.CLIENT)
public Vec3d getFogColor(World world, BlockPos pos, IBlockState state, Entity entity, Vec3d originalColor, float partialTicks) {
return new Vec3d(0.4, 0.03, 0.1);
}

public BlockFluidSimple setLiftsItems(boolean shouldLiftItems) {
this.liftsItems = shouldLiftItems;
return this;
Expand Down Expand Up @@ -112,24 +115,20 @@ public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState sta
}
return;
} else {
//slows everything else down

//slows everything else down - disables because atm it messes with upwards swimming and creative flight
/*
if (entity instanceof EntityPlayer) {
//Do the slowdown clientside-only
if (world.isRemote) {
applyFluidPhysics(entity);
}
} else {
applyFluidPhysics(entity);
}

}*/
}

if (world.isRemote) return;
if (fluidDamage!=null && !entity.isRiding()) {
//if (entity instanceof EntityLivingBase) {
// ((EntityLivingBase)entity).da
//}
entity.attackEntityFrom(fluidDamage, 1.0f);
entity.velocityChanged = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import java.util.List;

import com.elytradev.thermionics.world.gen.biome.BiomeRegistry;
import com.elytradev.thermionics.world.item.ItemBlockGemrock;
import com.elytradev.thermionics.world.item.TWItems;
import com.google.common.collect.ImmutableList;

Expand Down Expand Up @@ -113,7 +112,7 @@ public static void registerBlocks(RegistryEvent.Register<Block> event) {
*/
.setTemperature(600)
.setViscosity(1000);
FLUID_PAIN = fluidBlock(r, painFluid);
FLUID_PAIN = fluidBlock(r, painFluid).setLiftsItems(true);


//Gemrocks are not gems. But they're useful.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class ChunkProviderNeo implements IChunkGenerator {
public static final int DENSITY_SCALING_START = 200;
public static final int DENSITY_SCALING_LENGTH = HEIGHT - DENSITY_SCALING_START;

private static final long MILLIS_PER_NANO = 1_000_000L;
//private static final long MILLIS_PER_NANO = 1_000_000L;


protected static final IBlockState AIR = Blocks.AIR.getDefaultState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@

import javax.annotation.Nullable;

import com.google.common.base.Predicate;

import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
Expand Down Expand Up @@ -135,7 +133,7 @@ public boolean generate(World worldIn, Random rand, BlockPos position) {
}

public static class Quartz extends WorldGenerator {
private static final Predicate<IBlockState> REPLACEABLE = it->it.isFullCube();
//private static final Predicate<IBlockState> REPLACEABLE = it->it.isFullCube();

private final IBlockState oreBlock;
private final int numberOfBlocks;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ public Epicenter<E>[] recenterOn(int x, int z) {


public E get(int x, int z) {
float cx = rescale(x, scale);
float cz = rescale(z, scale);
//float cx = rescale(x, scale);
//float cz = rescale(z, scale);

Epicenter<E>[] centers = recenterOn(x, z);
float bestDist = Float.MAX_VALUE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.DimensionType;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.WorldProviderHell;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.Chunk;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,14 @@
*/
package com.elytradev.thermionics.world.gen.biome;

import java.util.Iterator;
import java.util.List;
import java.util.Random;

import javax.annotation.Nullable;

import com.elytradev.thermionics.world.block.TWBlocks;
import com.elytradev.thermionics.world.gen.VoronoiClusterField;
import com.google.common.collect.ImmutableList;

import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.WorldType;
import net.minecraft.world.biome.Biome;
Expand All @@ -49,17 +46,9 @@ public BiomeProviderNeo(WorldInfo info) {
super(info);

biomeSelector = new VoronoiClusterField<Biome>(info.getSeed(), 16*9);

//WHY ARE GENERICS BREAKING
Iterator<NeoBiome> iterator = BiomeRegistry.NEO_HELL.iterator();
while(iterator.hasNext()) {
NeoBiome biome = iterator.next();
biomeSelector.registerCell(biome, biome.getTemperature(), biome.getRainfall());
for(NeoBiome biome : BiomeRegistry.NEO_HELL) {
biomeSelector.registerCell(biome, biome.getDefaultTemperature(), biome.getRainfall());
}

//for(NeoBiome biome : BiomeRegistry.NEO_HELL.iterator()) {
// biomeSelector.registerCell(biome, biome.getTemperature(), biome.getRainfall());
//}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public boolean generate(World worldIn, Random rand, BlockPos position) {
cur = cur.up(4); //punch through a certain amount of incline, too.

ArrayList<BlockPos> buffer = new ArrayList<BlockPos>();
int depth = 20 + rand.nextInt(20);
//int depth = 20 + rand.nextInt(20);
for(int i=0; i<30; i++) {
float radius = 3f + rand.nextFloat()*4;

Expand Down
Loading

0 comments on commit 463772f

Please sign in to comment.