Run migration mappings

Everything is still broken, but at least we reduced the amount of errors by hundreds, if not thousands.
This commit is contained in:
Nicholas Ignoffo 2019-09-22 12:55:43 -07:00
parent 1caae69992
commit 4035d91151
484 changed files with 4924 additions and 4962 deletions

View file

@ -1,27 +1,23 @@
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
mavenCentral()
maven { url "http://files.minecraftforge.net/maven" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
}
}
plugins {
id "net.minecraftforge.gradle.forge" version "2.0.2"
id 'com.matthewprenger.cursegradle' version '1.1.0'
id 'maven-publish'
id "com.matthewprenger.cursegradle" version "1.3.0"
id "maven-publish"
}
def build_number = 'CUSTOM'
if (System.getenv('BUILD_NUMBER') != null)
build_number = System.getenv('BUILD_NUMBER')
apply plugin: 'net.minecraftforge.gradle'
def username = "${mod_name}"
if (project.hasProperty('dev_username'))
username = "${dev_username}"
def build_number = System.getenv('BUILD_NUMBER') != null ? System.getenv('BUILD_NUMBER') : 'CUSTOM'
def username = project.hasProperty('dev_username') ? "${dev_username}" : "${mod_name}"
group = package_group
archivesBaseName = mod_name
@ -33,38 +29,54 @@ repositories {
}
dependencies {
deobfCompile "mezz.jei:jei_${mc_version}:${jei_version}"
deobfCompile "mcp.mobius.waila:Hwyla:${waila_version}"
deobfCompile "info.amerifrance.guideapi:Guide-API:${guideapi_version}"
minecraft "net.minecraftforge:forge:${mc_version}-${forge_version}"
compile fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}")
compile fg.deobf("mcp.mobius.waila:Hwyla:${waila_version}")
}
minecraft {
version = "${mc_version}-${forge_version}"
runDir = "run"
mappings channel: "snapshot", version: "20190912-1.14.3"
replace "@VERSION@", project.version
replaceIn "BloodMagic.java"
runs {
client {
workingDirectory project.file('run')
property 'forge.logging.markers', ''
property 'forge.logging.console.level', 'info'
property 'username', username
clientRunArgs += "--username=${username}"
mods {
bloodmagic {
source sourceSets.main
}
}
}
if (project.hasProperty('mappings_version'))
mappings = project.mappings_version
server {
workingDirectory project.file('run/server')
property 'forge.logging.markers', ''
property 'forge.logging.console.level', 'info'
mods {
bloodmagic {
source sourceSets.main
}
}
}
}
}
apply from: "gradle/process_mod_info.gradle"
processResources {
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
from(sourceSets.main.resources.srcDirs) {
include '**/*.info'
include '**/*.properties'
include '**/*.toml'
expand 'version': project.version, 'mcversion': project.minecraft.version
expand 'version': project.version
}
from(sourceSets.main.resources.srcDirs) {
exclude '**/*.info'
exclude '**/*.properties'
exclude '**/*.toml'
}
}
@ -77,7 +89,6 @@ allprojects {
jar {
classifier = ''
from sourceSets.main.output
from sourceSets.api.output
manifest.mainAttributes(
"Built-By": System.getProperty('user.name'),
"Created-By": "${System.getProperty('java.vm.version')} + (${System.getProperty('java.vm.vendor')})",
@ -87,28 +98,21 @@ jar {
)
}
// API jar
task apiJar(type: Jar) {
classifier = 'api'
from sourceSets.api.output
// TODO: when FG bug is fixed, remove allJava from the api jar.
// https://github.com/MinecraftForge/ForgeGradle/issues/369
// Gradle should be able to pull them from the -sources jar.
from sourceSets.api.allJava
}
task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
classifier = 'javadoc'
include 'com/WayofTime/bloodmagic/api/**/*'
exclude 'com/WayofTime/bloodmagic/api/impl/**/*'
from sourceSets.main.allSource
from sourceSets.main.output
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
from sourceSets.api.allJava
}
tasks.build.dependsOn javadoc, javadocJar, apiJar, sourcesJar
tasks.build.dependsOn apiJar, sourcesJar
tasks.withType(JavaCompile) { task ->
task.options.encoding = 'UTF-8'
@ -119,7 +123,6 @@ publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
artifact javadocJar
artifact sourcesJar
artifact apiJar
}
@ -161,7 +164,6 @@ String getChangelogText() {
def curseRelations = {
optionalLibrary 'jei'
optionalLibrary 'hwyla'
requiredLibrary 'guide-api'
}
curseforge {
@ -175,7 +177,6 @@ curseforge {
relations curseRelations
addArtifact javadocJar
addArtifact sourcesJar
addArtifact apiJar
}

View file

@ -1,12 +1,13 @@
mod_name=BloodMagic
package_group=com.wayoftime.bloodmagic
mod_version=2.4.2
mc_version=1.12.2
forge_version=14.23.5.2808
mod_version=2.5.0
mc_version=1.14.4
forge_version=28.1.1
curse_id=224791
mappings_version=stable_39
mapping_channel=snapshot
mapping_version=20190912-1.14.3
jei_version=4.14.4.264
waila_version=1.8.26-B41_1.12.2
jei_version=6.0.0.11
waila_version=1.10.6-B67_1.14.4
guideapi_version=1.12-2.1.8-63

View file

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip

View file

@ -16,7 +16,7 @@ import WayofTime.bloodmagic.structures.ModDungeons;
import WayofTime.bloodmagic.util.PluginUtil;
import WayofTime.bloodmagic.util.handler.IMCHandler;
import com.google.common.collect.Lists;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.launchwrapper.Launch;
import net.minecraftforge.common.config.Configuration;
@ -40,13 +40,13 @@ public class BloodMagic {
public static final boolean IS_DEV = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
public static final List<Pair<IBloodMagicPlugin, BloodMagicPlugin>> PLUGINS = Lists.newArrayList();
public static final RitualManager RITUAL_MANAGER = new RitualManager(new Configuration(new File(Loader.instance().getConfigDir(), MODID + "/" + "rituals.cfg")));
public static final CreativeTabs TAB_BM = new CreativeTabs(MODID + ".creativeTab") {
public static final ItemGroup TAB_BM = new ItemGroup(MODID + ".creativeTab") {
@Override
public ItemStack createIcon() {
return OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_WEAK);
}
};
public static CreativeTabs TAB_TOMES = new CreativeTabs(MODID + ".creativeTabTome") {
public static ItemGroup TAB_TOMES = new ItemGroup(MODID + ".creativeTabTome") {
@Override
public ItemStack createIcon() {
return new ItemStack(RegistrarBloodMagicItems.UPGRADE_TOME);

View file

@ -1,9 +1,9 @@
package WayofTime.bloodmagic.alchemyArray;
import WayofTime.bloodmagic.iface.IAlchemyArray;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -17,13 +17,13 @@ public abstract class AlchemyArrayEffect {
public abstract boolean update(TileEntity tile, int ticksActive);
public abstract void writeToNBT(NBTTagCompound tag);
public abstract void writeToNBT(CompoundNBT tag);
public abstract void readFromNBT(NBTTagCompound tag);
public abstract void readFromNBT(CompoundNBT tag);
public abstract AlchemyArrayEffect getNewCopy();
public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, IBlockState state, Entity entity) {
public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, BlockState state, Entity entity) {
}

View file

@ -5,15 +5,15 @@ import java.util.List;
import javax.vecmath.Vector2d;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.projectile.EntityTippedArrow;
import net.minecraft.init.Items;
import net.minecraft.item.ItemArrow;
import net.minecraft.entity.MobEntity;
import net.minecraft.entity.monster.MonsterEntity;
import net.minecraft.entity.projectile.ArrowEntity;
import net.minecraft.item.ArrowItem;
import net.minecraft.item.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Direction;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
@ -23,7 +23,7 @@ import net.minecraftforge.items.IItemHandler;
import WayofTime.bloodmagic.util.Utils;
public class AlchemyArrayEffectArrowTurret extends AlchemyArrayEffect {
public EntityLiving target;
public MobEntity target;
public int arrowTimer;
public static final int ARROW_WINDUP = 50;
private int lastChestSlot = -1;
@ -47,7 +47,7 @@ public class AlchemyArrayEffectArrowTurret extends AlchemyArrayEffect {
if (chestTile == null) {
return false;
}
IItemHandler itemHandler = Utils.getInventory(chestTile, EnumFacing.UP);
IItemHandler itemHandler = Utils.getInventory(chestTile, Direction.UP);
if (itemHandler == null) {
return false;
}
@ -55,7 +55,7 @@ public class AlchemyArrayEffectArrowTurret extends AlchemyArrayEffect {
ItemStack arrowStack = new ItemStack(Items.AIR);
if (lastChestSlot >= 0 && lastChestSlot < itemHandler.getSlots()) {
ItemStack testStack = itemHandler.extractItem(lastChestSlot, 1, true);
if (testStack.isEmpty() || !(testStack.getItem() instanceof ItemArrow)) {
if (testStack.isEmpty() || !(testStack.getItem() instanceof ArrowItem)) {
lastChestSlot = -1;
} else {
arrowStack = testStack;
@ -65,7 +65,7 @@ public class AlchemyArrayEffectArrowTurret extends AlchemyArrayEffect {
if (lastChestSlot < 0) {
for (int i = 0; i < itemHandler.getSlots(); i++) {
ItemStack testStack = itemHandler.extractItem(i, 1, true);
if (!testStack.isEmpty() && testStack.getItem() instanceof ItemArrow) {
if (!testStack.isEmpty() && testStack.getItem() instanceof ArrowItem) {
arrowStack = testStack;
lastChestSlot = i;
break;
@ -100,9 +100,9 @@ public class AlchemyArrayEffectArrowTurret extends AlchemyArrayEffect {
arrowTimer = -1;
}
List<EntityMob> mobsInRange = world.getEntitiesWithinAABB(EntityMob.class, getBounds(pos));
List<MonsterEntity> mobsInRange = world.getEntitiesWithinAABB(MonsterEntity.class, getBounds(pos));
for (EntityMob entity : mobsInRange) {
for (MonsterEntity entity : mobsInRange) {
if (canFireOnMob(world, pos, entity))// && isMobInFilter(ent))
{
target = entity;
@ -132,14 +132,14 @@ public class AlchemyArrayEffectArrowTurret extends AlchemyArrayEffect {
return lastYaw;
}
public void fireOnTarget(World world, BlockPos pos, ItemStack arrowStack, EntityLiving targetMob) {
public void fireOnTarget(World world, BlockPos pos, ItemStack arrowStack, MobEntity targetMob) {
float vel = 3f;
double damage = 2;
if (!world.isRemote) {
if (arrowStack.getItem() instanceof ItemArrow) {
if (arrowStack.getItem() instanceof ArrowItem) {
// ItemArrow arrow = (ItemArrow) arrowStack.getItem();
// EntityArrow entityarrow = arrow.createArrow(world, arrowStack, targetMob);
EntityTippedArrow entityarrow = new EntityTippedArrow(world);
ArrowEntity entityarrow = new ArrowEntity(world);
entityarrow.setPotionEffect(arrowStack);
entityarrow.posX = pos.getX() + 0.5;
entityarrow.posY = pos.getY() + 0.5;
@ -192,12 +192,12 @@ public class AlchemyArrayEffectArrowTurret extends AlchemyArrayEffect {
}
@Override
public void writeToNBT(NBTTagCompound tag) {
public void writeToNBT(CompoundNBT tag) {
}
@Override
public void readFromNBT(NBTTagCompound tag) {
public void readFromNBT(CompoundNBT tag) {
}

View file

@ -5,12 +5,12 @@ import WayofTime.bloodmagic.fakePlayer.FakePlayerBM;
import WayofTime.bloodmagic.tile.TileAlchemyArray;
import com.mojang.authlib.GameProfile;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.ai.EntityAITasks;
import net.minecraft.entity.ai.EntityAITasks.EntityAITaskEntry;
import net.minecraft.entity.MobEntity;
import net.minecraft.entity.ai.goal.Goal;
import net.minecraft.entity.ai.goal.GoalSelector;
import net.minecraft.entity.ai.goal.GoalSelector.EntityAITaskEntry;
import net.minecraft.entity.monster.*;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.pathfinding.Path;
import net.minecraft.pathfinding.PathFinder;
import net.minecraft.pathfinding.WalkNodeProcessor;
@ -28,7 +28,7 @@ import java.util.*;
*/
public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect {
private FakePlayer target;
private Set<EntityLiving> tracking = new HashSet<>();
private Set<MobEntity> tracking = new HashSet<>();
private int counter = 0;
private int maxMobsAttracted = 10000;
@ -48,7 +48,7 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect {
BlockPos pos = tile.getPos();
counter++;
if (counter < 10) {
for (EntityLiving ent : tracking) {
for (MobEntity ent : tracking) {
onEntityTick(pos, ent);
}
@ -59,10 +59,10 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect {
World world = tile.getWorld();
Set<EntityLiving> trackingThisTick = new HashSet<>();
List<EntityLiving> entsInBounds = world.getEntitiesWithinAABB(EntityLiving.class, getBounds(pos));
Set<MobEntity> trackingThisTick = new HashSet<>();
List<MobEntity> entsInBounds = world.getEntitiesWithinAABB(MobEntity.class, getBounds(pos));
for (EntityLiving ent : entsInBounds) {
for (MobEntity ent : entsInBounds) {
if (!ent.isDead)// && isMobInFilter(ent))
{
double x = (pos.getX() + 0.5D - ent.posX);
@ -92,7 +92,7 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect {
}
}
for (EntityLiving e : tracking) {
for (MobEntity e : tracking) {
if (!trackingThisTick.contains(e)) {
onUntracked(e);
}
@ -103,7 +103,7 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect {
return false;
}
public boolean canEntityBeTracked(BlockPos pos, EntityLiving entity) {
public boolean canEntityBeTracked(BlockPos pos, MobEntity entity) {
return getEntityCooldown(pos, entity) <= 0;
}
@ -111,15 +111,15 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect {
return "BMAttractor:" + pos;
}
public int getEntityCooldown(BlockPos pos, EntityLiving entity) {
public int getEntityCooldown(BlockPos pos, MobEntity entity) {
return entity.getEntityData().getInteger(getPosKey(pos));
}
public void setEntityCooldown(BlockPos pos, EntityLiving entity, int cooldown) {
public void setEntityCooldown(BlockPos pos, MobEntity entity, int cooldown) {
entity.getEntityData().setInteger(getPosKey(pos), cooldown);
}
public void decrementEntityCooldown(BlockPos pos, EntityLiving entity) {
public void decrementEntityCooldown(BlockPos pos, MobEntity entity) {
int cooldown = getEntityCooldown(pos, entity);
if (cooldown > 0) {
setEntityCooldown(pos, entity, cooldown - 1);
@ -134,29 +134,29 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect {
return 10;
}
private void onUntracked(EntityLiving e) {
if (e instanceof EntityEnderman) {
private void onUntracked(MobEntity e) {
if (e instanceof EndermanEntity) {
e.getEntityData().setBoolean("BM:tracked", false);
}
}
private void onTracked(EntityLiving e) {
if (e instanceof EntityEnderman) {
private void onTracked(MobEntity e) {
if (e instanceof EndermanEntity) {
e.getEntityData().setBoolean("BM:tracked", true);
}
}
private void onEntityTick(BlockPos pos, EntityLiving ent) {
if (ent instanceof EntitySlime) {
private void onEntityTick(BlockPos pos, MobEntity ent) {
if (ent instanceof SlimeEntity) {
ent.faceEntity(getTarget(ent.getEntityWorld(), pos), 10.0F, 20.0F);
} else if (ent instanceof EntitySilverfish) {
} else if (ent instanceof SilverfishEntity) {
if (counter < 10) {
return;
}
EntitySilverfish sf = (EntitySilverfish) ent;
SilverfishEntity sf = (SilverfishEntity) ent;
Path pathentity = getPathEntityToEntity(ent, getTarget(ent.getEntityWorld(), pos), getRange());
sf.getNavigator().setPath(pathentity, sf.getAIMoveSpeed());
} else if (ent instanceof EntityBlaze) {
} else if (ent instanceof BlazeEntity) {
double x = (pos.getX() + 0.5D - ent.posX);
double y = (pos.getY() + 1D - ent.posY);
double z = (pos.getZ() + 0.5D - ent.posZ);
@ -169,21 +169,21 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect {
}
ent.motionZ += z / distance * speed;
}
} else if (ent instanceof EntityPigZombie || ent instanceof EntitySpider) {
} else if (ent instanceof ZombiePigmanEntity || ent instanceof SpiderEntity) {
forceMove(pos, ent);
// ent.setAttackTarget(target);
} else if (ent instanceof EntityEnderman) {
} else if (ent instanceof EndermanEntity) {
ent.setAttackTarget(getTarget(ent.getEntityWorld(), pos));
}
}
private void forceMove(BlockPos pos, EntityLiving ent) {
private void forceMove(BlockPos pos, MobEntity ent) {
double x = (pos.getX() + 0.5D - ent.posX);
double y = (pos.getY() + 1D - ent.posY);
double z = (pos.getZ() + 0.5D - ent.posZ);
double distance = Math.sqrt(x * x + y * y + z * z);
if (distance > 2) {
EntityMob mod = (EntityMob) ent;
MonsterEntity mod = (MonsterEntity) ent;
mod.faceEntity(getTarget(ent.getEntityWorld(), pos), 180, 0);
mod.getMoveHelper().strafe(0, 0.3f);
if (mod.posY < pos.getY()) {
@ -200,10 +200,10 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect {
int targZ = MathHelper.floor(targetEntity.posZ);
PathFinder pf = new PathFinder(new WalkNodeProcessor());
return pf.findPath(targetEntity.getEntityWorld(), (EntityLiving) entity, new BlockPos(targX, targY, targZ), range);
return pf.findPath(targetEntity.getEntityWorld(), (MobEntity) entity, new BlockPos(targX, targY, targZ), range);
}
private boolean trackMob(BlockPos pos, EntityLiving ent) {
private boolean trackMob(BlockPos pos, MobEntity ent) {
//TODO: Figure out if this crud is needed
if (useSetTarget(ent)) {
ent.setAttackTarget(getTarget(ent.getEntityWorld(), pos));
@ -215,13 +215,13 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect {
}
}
private boolean useSetTarget(EntityLiving ent) {
return ent instanceof EntityPigZombie || ent instanceof EntitySpider || ent instanceof EntitySilverfish;
private boolean useSetTarget(MobEntity ent) {
return ent instanceof ZombiePigmanEntity || ent instanceof SpiderEntity || ent instanceof SilverfishEntity;
}
public void removeAssignedAITask(BlockPos pos, EntityLiving ent) {
public void removeAssignedAITask(BlockPos pos, MobEntity ent) {
Set<EntityAITaskEntry> entries = ent.tasks.taskEntries;
EntityAIBase remove = null;
Goal remove = null;
for (EntityAITaskEntry entry : entries) {
if (entry.action instanceof AttractTask) {
AttractTask at = (AttractTask) entry.action;
@ -237,11 +237,11 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect {
}
}
private boolean attractUsingAITask(BlockPos pos, EntityLiving ent) {
private boolean attractUsingAITask(BlockPos pos, MobEntity ent) {
tracking.add(ent);
Set<EntityAITaskEntry> entries = ent.tasks.taskEntries;
// boolean hasTask = false;
EntityAIBase remove = null;
Goal remove = null;
// boolean isTracked;
for (EntityAITaskEntry entry : entries) {
if (entry.action instanceof AttractTask) {
@ -263,10 +263,10 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect {
return true;
}
private void cancelCurrentTasks(EntityLiving ent) {
private void cancelCurrentTasks(MobEntity ent) {
Iterator<EntityAITaskEntry> iterator = ent.tasks.taskEntries.iterator();
List<EntityAITasks.EntityAITaskEntry> currentTasks = new ArrayList<>();
List<GoalSelector.EntityAITaskEntry> currentTasks = new ArrayList<>();
while (iterator.hasNext()) {
EntityAITaskEntry entityaitaskentry = iterator.next();
if (entityaitaskentry != null) {
@ -285,24 +285,24 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect {
}
}
private boolean applySpecialCase(BlockPos pos, EntityLiving ent) {
if (ent instanceof EntitySlime) {
private boolean applySpecialCase(BlockPos pos, MobEntity ent) {
if (ent instanceof SlimeEntity) {
ent.faceEntity(getTarget(ent.getEntityWorld(), pos), 10.0F, 20.0F);
// ent.setAttackTarget(getTarget(ent.worldObj, pos));
return true;
} else if (ent instanceof EntitySilverfish) {
EntitySilverfish es = (EntitySilverfish) ent;
} else if (ent instanceof SilverfishEntity) {
SilverfishEntity es = (SilverfishEntity) ent;
Path pathentity = getPathEntityToEntity(ent, getTarget(ent.getEntityWorld(), pos), getRange());
es.getNavigator().setPath(pathentity, es.getAIMoveSpeed());
return true;
} else if (ent instanceof EntityBlaze) {
} else if (ent instanceof BlazeEntity) {
return true;
}
return false;
}
private boolean useSpecialCase(EntityLiving ent) {
return ent instanceof EntitySlime || ent instanceof EntitySilverfish || ent instanceof EntityBlaze;
private boolean useSpecialCase(MobEntity ent) {
return ent instanceof SlimeEntity || ent instanceof SilverfishEntity || ent instanceof BlazeEntity;
}
public FakePlayer getTarget(World world, BlockPos pos) {
@ -315,12 +315,12 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect {
}
@Override
public void writeToNBT(NBTTagCompound tag) {
public void writeToNBT(CompoundNBT tag) {
}
@Override
public void readFromNBT(NBTTagCompound tag) {
public void readFromNBT(CompoundNBT tag) {
}
@ -329,15 +329,15 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect {
return new AlchemyArrayEffectAttractor(key);
}
private static class AttractTask extends EntityAIBase {
private EntityLiving mob;
private static class AttractTask extends Goal {
private MobEntity mob;
private BlockPos coord;
private FakePlayer target;
private int updatesSincePathing;
private boolean started = false;
private AttractTask(EntityLiving mob, FakePlayer target, BlockPos coord) {
private AttractTask(MobEntity mob, FakePlayer target, BlockPos coord) {
this.mob = mob;
this.coord = coord;
this.target = target;

View file

@ -1,10 +1,10 @@
package WayofTime.bloodmagic.alchemyArray;
import WayofTime.bloodmagic.client.render.alchemyArray.BindingAlchemyCircleRenderer;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.effect.LightningBoltEntity;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -30,7 +30,7 @@ public class AlchemyArrayEffectBinding extends AlchemyArrayEffectCrafting {
BlockPos pos = tile.getPos();
ItemStack output = outputStack.copy();
EntityItem outputEntity = new EntityItem(tile.getWorld(), pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, output);
ItemEntity outputEntity = new ItemEntity(tile.getWorld(), pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, output);
tile.getWorld().spawnEntity(outputEntity);
@ -49,18 +49,18 @@ public class AlchemyArrayEffectBinding extends AlchemyArrayEffectCrafting {
double dispX = distance * Math.sin(angle);
double dispZ = -distance * Math.cos(angle);
EntityLightningBolt lightning = new EntityLightningBolt(world, pos.getX() + dispX, pos.getY(), pos.getZ() + dispZ, true);
LightningBoltEntity lightning = new LightningBoltEntity(world, pos.getX() + dispX, pos.getY(), pos.getZ() + dispZ, true);
world.spawnEntity(lightning);
}
}
@Override
public void writeToNBT(NBTTagCompound tag) {
public void writeToNBT(CompoundNBT tag) {
//EMPTY
}
@Override
public void readFromNBT(NBTTagCompound tag) {
public void readFromNBT(CompoundNBT tag) {
//EMPTY
}

View file

@ -1,10 +1,10 @@
package WayofTime.bloodmagic.alchemyArray;
import WayofTime.bloodmagic.iface.IAlchemyArray;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.entity.LivingEntity;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -20,13 +20,13 @@ public class AlchemyArrayEffectBounce extends AlchemyArrayEffect {
}
@Override
public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, IBlockState state, Entity entity) {
public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, BlockState state, Entity entity) {
if (entity.isSneaking()) {
entity.fallDistance = 0;
} else if (entity.motionY < 0.0D) {
entity.motionY = -entity.motionY;
if (!(entity instanceof EntityLivingBase)) {
if (!(entity instanceof LivingEntity)) {
entity.motionY *= 0.8D;
}
@ -35,12 +35,12 @@ public class AlchemyArrayEffectBounce extends AlchemyArrayEffect {
}
@Override
public void writeToNBT(NBTTagCompound tag) {
public void writeToNBT(CompoundNBT tag) {
}
@Override
public void readFromNBT(NBTTagCompound tag) {
public void readFromNBT(CompoundNBT tag) {
}

View file

@ -1,8 +1,8 @@
package WayofTime.bloodmagic.alchemyArray;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
@ -36,7 +36,7 @@ public class AlchemyArrayEffectCrafting extends AlchemyArrayEffect {
ItemStack output = outputStack.copy();
EntityItem outputEntity = new EntityItem(tile.getWorld(), pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, output);
ItemEntity outputEntity = new ItemEntity(tile.getWorld(), pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, output);
tile.getWorld().spawnEntity(outputEntity);
@ -47,12 +47,12 @@ public class AlchemyArrayEffectCrafting extends AlchemyArrayEffect {
}
@Override
public void writeToNBT(NBTTagCompound tag) {
public void writeToNBT(CompoundNBT tag) {
}
@Override
public void readFromNBT(NBTTagCompound tag) {
public void readFromNBT(CompoundNBT tag) {
}

View file

@ -1,9 +1,9 @@
package WayofTime.bloodmagic.alchemyArray;
import WayofTime.bloodmagic.api.impl.recipe.RecipeAlchemyArray;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
@ -31,7 +31,7 @@ public class AlchemyArrayEffectCraftingNew extends AlchemyArrayEffect {
ItemStack output = recipe.getOutput().copy();
EntityItem outputEntity = new EntityItem(tile.getWorld(), pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, output);
ItemEntity outputEntity = new ItemEntity(tile.getWorld(), pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, output);
tile.getWorld().spawnEntity(outputEntity);
@ -42,12 +42,12 @@ public class AlchemyArrayEffectCraftingNew extends AlchemyArrayEffect {
}
@Override
public void writeToNBT(NBTTagCompound tag) {
public void writeToNBT(CompoundNBT tag) {
}
@Override
public void readFromNBT(NBTTagCompound tag) {
public void readFromNBT(CompoundNBT tag) {
}

View file

@ -4,15 +4,15 @@ import java.util.List;
import WayofTime.bloodmagic.util.DamageSourceBloodMagic;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFurnace;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.block.Blocks;
import net.minecraft.block.FurnaceBlock;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.FurnaceTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Direction;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -29,9 +29,9 @@ public class AlchemyArrayEffectFurnaceFuel extends AlchemyArrayEffect {
public boolean update(TileEntity tile, int ticksActive) {
BlockPos pos = tile.getPos();
World world = tile.getWorld();
EntityPlayer sacrifice = null;
PlayerEntity sacrifice = null;
for (EnumFacing face : EnumFacing.VALUES) {
for (Direction face : Direction.VALUES) {
BlockPos furnacePos = pos.offset(face);
Block block = world.getBlockState(furnacePos).getBlock();
if (block != Blocks.FURNACE) //This will only work vanilla furnaces. No others!
@ -40,13 +40,13 @@ public class AlchemyArrayEffectFurnaceFuel extends AlchemyArrayEffect {
}
TileEntity bottomTile = world.getTileEntity(furnacePos);
if (bottomTile instanceof TileEntityFurnace) {
TileEntityFurnace furnaceTile = (TileEntityFurnace) bottomTile;
if (bottomTile instanceof FurnaceTileEntity) {
FurnaceTileEntity furnaceTile = (FurnaceTileEntity) bottomTile;
if (canFurnaceSmelt(furnaceTile) && !furnaceTile.isBurning()) {
if (sacrifice == null || sacrifice.isDead) {
AxisAlignedBB bb = new AxisAlignedBB(pos).grow(radius);
List<EntityPlayer> playerList = world.getEntitiesWithinAABB(EntityPlayer.class, bb);
for (EntityPlayer player : playerList) {
List<PlayerEntity> playerList = world.getEntitiesWithinAABB(PlayerEntity.class, bb);
for (PlayerEntity player : playerList) {
if (!player.isDead) {
sacrifice = player;
}
@ -70,13 +70,13 @@ public class AlchemyArrayEffectFurnaceFuel extends AlchemyArrayEffect {
return false;
}
public static boolean addFuelTime(TileEntityFurnace furnaceTile, World world, BlockPos furnacePos, int cookTime) {
public static boolean addFuelTime(FurnaceTileEntity furnaceTile, World world, BlockPos furnacePos, int cookTime) {
furnaceTile.setField(0, cookTime);
BlockFurnace.setState(true, world, furnacePos);
FurnaceBlock.setState(true, world, furnacePos);
return true;
}
public static boolean canFurnaceSmelt(TileEntityFurnace furnaceTile) {
public static boolean canFurnaceSmelt(FurnaceTileEntity furnaceTile) {
ItemStack burnStack = furnaceTile.getStackInSlot(0);
if (burnStack.isEmpty()) {
return false;
@ -103,12 +103,12 @@ public class AlchemyArrayEffectFurnaceFuel extends AlchemyArrayEffect {
}
@Override
public void writeToNBT(NBTTagCompound tag) {
public void writeToNBT(CompoundNBT tag) {
}
@Override
public void readFromNBT(NBTTagCompound tag) {
public void readFromNBT(CompoundNBT tag) {
}

View file

@ -2,8 +2,8 @@ package WayofTime.bloodmagic.alchemyArray;
import java.util.Random;
import net.minecraft.block.state.IBlockState;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.block.BlockState;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -71,7 +71,7 @@ public class AlchemyArrayEffectLaputa extends AlchemyArrayEffect {
if (checkIfSphere(radius, i, j, k)) {
BlockPos newPos = pos.add(i, j, k);
BlockPos offsetPos = newPos.up(teleportHeightOffset);
IBlockState state = world.getBlockState(newPos);
BlockState state = world.getBlockState(newPos);
TeleposeEvent event = new TeleposeEvent(world, newPos, world, offsetPos);
if (state.getBlockHardness(world, newPos) > 0 && !MinecraftForge.EVENT_BUS.post(event) && Utils.swapLocations(event.initalWorld, event.initialBlockPos, event.finalWorld, event.finalBlockPos)) {
@ -112,7 +112,7 @@ public class AlchemyArrayEffectLaputa extends AlchemyArrayEffect {
}
@Override
public void writeToNBT(NBTTagCompound tag) {
public void writeToNBT(CompoundNBT tag) {
tag.setInteger("radius", radius);
tag.setInteger("teleportHeightOffset", teleportHeightOffset);
tag.setInteger(Constants.NBT.X_COORD, currentPos.getX());
@ -121,7 +121,7 @@ public class AlchemyArrayEffectLaputa extends AlchemyArrayEffect {
}
@Override
public void readFromNBT(NBTTagCompound tag) {
public void readFromNBT(CompoundNBT tag) {
radius = tag.getInteger("radius");
teleportHeightOffset = tag.getInteger("teleportHeightOffset");
currentPos = new BlockPos(tag.getInteger(Constants.NBT.X_COORD), tag.getInteger(Constants.NBT.Y_COORD), tag.getInteger(Constants.NBT.Z_COORD));

View file

@ -4,30 +4,27 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.entity.monster.IMob;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.SoundEvents;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.SoundEvents;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraft.world.ServerWorld;
import net.minecraftforge.fml.common.registry.EntityEntry;
import net.minecraftforge.fml.common.registry.EntityRegistry;
import WayofTime.bloodmagic.api.impl.BloodMagicAPI;
import WayofTime.bloodmagic.api.impl.recipe.RecipeSacrificeCraft;
import WayofTime.bloodmagic.ritual.AreaDescriptor;
import WayofTime.bloodmagic.util.DamageSourceBloodMagic;
import WayofTime.bloodmagic.util.helper.PurificationHelper;
public class AlchemyArrayEffectMobSacrifice extends AlchemyArrayEffect {
public static final AreaDescriptor itemDescriptor = new AreaDescriptor.Rectangle(new BlockPos(-5, -5, -5), 11);
@ -59,11 +56,11 @@ public class AlchemyArrayEffectMobSacrifice extends AlchemyArrayEffect {
if (ticksActive >= 200) {
BlockPos pos = tile.getPos();
List<EntityItem> itemList = world.getEntitiesWithinAABB(EntityItem.class, itemDescriptor.getAABB(pos));
List<ItemEntity> itemList = world.getEntitiesWithinAABB(ItemEntity.class, itemDescriptor.getAABB(pos));
List<ItemStack> inputList = new ArrayList<ItemStack>();
for (EntityItem entityItem : itemList) {
for (ItemEntity entityItem : itemList) {
if (entityItem.isDead || entityItem.getItem().isEmpty()) {
continue;
}
@ -85,8 +82,8 @@ public class AlchemyArrayEffectMobSacrifice extends AlchemyArrayEffect {
double healthRequired = recipe.getHealthRequired();
double healthAvailable = 0;
List<EntityLivingBase> livingEntities = world.getEntitiesWithinAABB(EntityLivingBase.class, mobDescriptor.getAABB(pos));
for (EntityLivingBase living : livingEntities) {
List<LivingEntity> livingEntities = world.getEntitiesWithinAABB(LivingEntity.class, mobDescriptor.getAABB(pos));
for (LivingEntity living : livingEntities) {
double health = getEffectiveHealth(living);
if (health > 0) {
healthAvailable += health;
@ -102,7 +99,7 @@ public class AlchemyArrayEffectMobSacrifice extends AlchemyArrayEffect {
if (craftTime >= REQUIRED_CRAFT_TIME) {
if (!world.isRemote) {
for (EntityLivingBase living : livingEntities) {
for (LivingEntity living : livingEntities) {
double health = getEffectiveHealth(living);
if (healthAvailable > 0 && health > 0) {
healthAvailable -= health;
@ -116,7 +113,7 @@ public class AlchemyArrayEffectMobSacrifice extends AlchemyArrayEffect {
}
}
for (EntityItem itemEntity : itemList) {
for (ItemEntity itemEntity : itemList) {
itemEntity.getItem().setCount(itemEntity.getItem().getCount() - 1);
if (itemEntity.getItem().isEmpty()) //TODO: Check container
{
@ -124,13 +121,13 @@ public class AlchemyArrayEffectMobSacrifice extends AlchemyArrayEffect {
}
}
world.spawnEntity(new EntityItem(world, pos.getX() + 0.5, pos.getY() + 2.5, pos.getZ() + 0.5, recipe.getOutput()));
world.spawnEntity(new ItemEntity(world, pos.getX() + 0.5, pos.getY() + 2.5, pos.getZ() + 0.5, recipe.getOutput()));
craftTime = 0;
}
} else {
if (world.isRemote) {
Vec3d spawnPosition = new Vec3d(pos.getX() + 0.5, pos.getY() + 2.5, pos.getZ() + 0.5);
for (EntityItem itemEntity : itemList) {
for (ItemEntity itemEntity : itemList) {
ItemStack stack = itemEntity.getItem();
double velocityFactor = 0.1;
@ -146,7 +143,7 @@ public class AlchemyArrayEffectMobSacrifice extends AlchemyArrayEffect {
// world.spawnParticle(EnumParticleTypes.ITEM_CRACK, spawnPosition.x, spawnPosition.y, spawnPosition.z, velVec2.x, velVec2.y, velVec2.z, Item.getIdFromItem(stack.getItem()), stack.getMetadata());
}
for (EntityLivingBase living : livingEntities) {
for (LivingEntity living : livingEntities) {
double health = getEffectiveHealth(living);
if (health <= 0) {
continue;
@ -165,14 +162,14 @@ public class AlchemyArrayEffectMobSacrifice extends AlchemyArrayEffect {
}
//Future-proofing in case I want to make different mobs give different effective health
public double getEffectiveHealth(EntityLivingBase living) {
public double getEffectiveHealth(LivingEntity living) {
if (living == null)
return 0;
if (!living.isNonBoss())
return 0;
if (living instanceof EntityPlayer)
if (living instanceof PlayerEntity)
return 0;
if (living.isChild() && !(living instanceof IMob))
@ -189,12 +186,12 @@ public class AlchemyArrayEffectMobSacrifice extends AlchemyArrayEffect {
}
@Override
public void writeToNBT(NBTTagCompound tag) {
public void writeToNBT(CompoundNBT tag) {
}
@Override
public void readFromNBT(NBTTagCompound tag) {
public void readFromNBT(CompoundNBT tag) {
}

View file

@ -2,11 +2,11 @@ package WayofTime.bloodmagic.alchemyArray;
import WayofTime.bloodmagic.iface.IAlchemyArray;
import WayofTime.bloodmagic.tile.TileAlchemyArray;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -21,13 +21,13 @@ public class AlchemyArrayEffectMovement extends AlchemyArrayEffect {
}
@Override
public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, IBlockState state, Entity entity) {
public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, BlockState state, Entity entity) {
double motionY = 0.5;
double motionYGlowstoneMod = 0.05;
double speed = 1.5;
double speedRedstoneMod = 0.15;
EnumFacing direction = array.getRotation();
Direction direction = array.getRotation();
TileAlchemyArray tileArray = (TileAlchemyArray) array;
motionY += motionYGlowstoneMod * (tileArray.getStackInSlot(0).getCount() - 1);
@ -66,12 +66,12 @@ public class AlchemyArrayEffectMovement extends AlchemyArrayEffect {
}
@Override
public void writeToNBT(NBTTagCompound tag) {
public void writeToNBT(CompoundNBT tag) {
}
@Override
public void readFromNBT(NBTTagCompound tag) {
public void readFromNBT(CompoundNBT tag) {
}

View file

@ -1,7 +1,7 @@
package WayofTime.bloodmagic.alchemyArray;
import WayofTime.bloodmagic.iface.ISigil;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntity;
public class AlchemyArrayEffectSigil extends AlchemyArrayEffect {
@ -23,12 +23,12 @@ public class AlchemyArrayEffectSigil extends AlchemyArrayEffect {
}
@Override
public void writeToNBT(NBTTagCompound tag) {
public void writeToNBT(CompoundNBT tag) {
}
@Override
public void readFromNBT(NBTTagCompound tag) {
public void readFromNBT(CompoundNBT tag) {
}

View file

@ -2,15 +2,15 @@ package WayofTime.bloodmagic.alchemyArray;
import WayofTime.bloodmagic.tile.TileAlchemyArray;
import com.google.common.base.Predicate;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.MobEntity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAITasks;
import net.minecraft.entity.ai.EntityAITasks.EntityAITaskEntry;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.entity.ai.goal.GoalSelector;
import net.minecraft.entity.ai.goal.GoalSelector.EntityAITaskEntry;
import net.minecraft.entity.ai.goal.Goal;
import net.minecraft.entity.ai.goal.NearestAttackableTargetGoal;
import net.minecraft.entity.monster.MonsterEntity;
import net.minecraft.entity.monster.SkeletonEntity;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
@ -25,8 +25,8 @@ import java.util.List;
* Credits for the initial code go to Crazy Pants of EIO.
*/
public class AlchemyArrayEffectSkeletonTurret extends AlchemyArrayEffect {
public static Predicate<EntityMob> checkSkeleton = input -> !(input instanceof EntitySkeleton);
private EntitySkeleton turret;
public static Predicate<MonsterEntity> checkSkeleton = input -> !(input instanceof SkeletonEntity);
private SkeletonEntity turret;
public AlchemyArrayEffectSkeletonTurret(String key) {
super(key);
@ -55,9 +55,9 @@ public class AlchemyArrayEffectSkeletonTurret extends AlchemyArrayEffect {
World world = tile.getWorld();
List<EntitySkeleton> skeletonsInRange = world.getEntitiesWithinAABB(EntitySkeleton.class, getBounds(pos));
List<SkeletonEntity> skeletonsInRange = world.getEntitiesWithinAABB(SkeletonEntity.class, getBounds(pos));
for (EntitySkeleton entity : skeletonsInRange) {
for (SkeletonEntity entity : skeletonsInRange) {
if (!entity.isDead)// && isMobInFilter(ent))
{
modifyAITargetTasks(entity);
@ -87,20 +87,20 @@ public class AlchemyArrayEffectSkeletonTurret extends AlchemyArrayEffect {
// e.getEntityData().setBoolean("BM:tracked", true);
// }
private boolean modifyAITargetTasks(EntitySkeleton entity) {
private boolean modifyAITargetTasks(SkeletonEntity entity) {
cancelCurrentTargetTasks(entity);
// entity.setCombatTask();
entity.targetTasks.addTask(1, new EntityAINearestAttackableTarget(entity, EntityMob.class, 10, true, false, checkSkeleton));
entity.targetTasks.addTask(1, new NearestAttackableTargetGoal(entity, MonsterEntity.class, 10, true, false, checkSkeleton));
entity.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0);
entity.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(1);
return true;
}
private void cancelCurrentTargetTasks(EntityLiving entity) {
private void cancelCurrentTargetTasks(MobEntity entity) {
Iterator<EntityAITaskEntry> iterator = entity.targetTasks.taskEntries.iterator();
List<EntityAITasks.EntityAITaskEntry> currentTasks = new ArrayList<>();
List<GoalSelector.EntityAITaskEntry> currentTasks = new ArrayList<>();
while (iterator.hasNext()) {
EntityAITaskEntry entityaitaskentry = iterator.next();
if (entityaitaskentry != null)// && entityaitaskentry.action instanceof EntityAITarget)
@ -115,12 +115,12 @@ public class AlchemyArrayEffectSkeletonTurret extends AlchemyArrayEffect {
}
@Override
public void writeToNBT(NBTTagCompound tag) {
public void writeToNBT(CompoundNBT tag) {
}
@Override
public void readFromNBT(NBTTagCompound tag) {
public void readFromNBT(CompoundNBT tag) {
}
@ -129,15 +129,15 @@ public class AlchemyArrayEffectSkeletonTurret extends AlchemyArrayEffect {
return new AlchemyArrayEffectSkeletonTurret(key);
}
private static class AttractTask extends EntityAIBase {
private EntityLiving mob;
private static class AttractTask extends Goal {
private MobEntity mob;
private BlockPos coord;
private FakePlayer target;
private int updatesSincePathing;
private boolean started = false;
private AttractTask(EntityLiving mob, FakePlayer target, BlockPos coord) {
private AttractTask(MobEntity mob, FakePlayer target, BlockPos coord) {
this.mob = mob;
this.coord = coord;
this.target = target;

View file

@ -1,9 +1,9 @@
package WayofTime.bloodmagic.alchemyArray;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.entity.LivingEntity;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.util.math.BlockPos;
@ -21,19 +21,19 @@ public class AlchemyArrayEffectSpike extends AlchemyArrayEffect {
}
@Override
public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, IBlockState state, Entity entity) {
if (entity instanceof EntityLivingBase) {
public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, BlockState state, Entity entity) {
if (entity instanceof LivingEntity) {
entity.attackEntityFrom(DamageSource.CACTUS, 2);
}
}
@Override
public void writeToNBT(NBTTagCompound tag) {
public void writeToNBT(CompoundNBT tag) {
}
@Override
public void readFromNBT(NBTTagCompound tag) {
public void readFromNBT(CompoundNBT tag) {
}

View file

@ -1,19 +1,19 @@
package WayofTime.bloodmagic.alchemyArray;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.SoundEvents;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.play.server.SPacketUpdateHealth;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.Direction;
import net.minecraft.util.SoundEvents;
import net.minecraft.network.play.server.SUpdateHealthPacket;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ServerWorld;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
import WayofTime.bloodmagic.iface.IAlchemyArray;
@ -31,13 +31,13 @@ public class AlchemyArrayEffectTeleport extends AlchemyArrayEffect {
}
@Override
public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, IBlockState state, Entity entity) {
EnumFacing direction = array.getRotation();
public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, BlockState state, Entity entity) {
Direction direction = array.getRotation();
teleportEntityInDirection(world, pos, entity, direction);
}
public void teleportEntityInDirection(World world, BlockPos currentPos, Entity entity, EnumFacing direction) {
public void teleportEntityInDirection(World world, BlockPos currentPos, Entity entity, Direction direction) {
if (entity != null && entity.timeUntilPortal <= 0) {
for (int i = 1; i <= MAX_SEARCH; i++) {
BlockPos offsetPos = currentPos.offset(direction, i);
@ -50,15 +50,15 @@ public class AlchemyArrayEffectTeleport extends AlchemyArrayEffect {
entity.getEntityWorld().playSound(x, y, z, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.AMBIENT, 1.0F, 1.0F, false);
entity.timeUntilPortal = TELEPORT_DELAY;
if (!world.isRemote) {
if (entity instanceof EntityPlayer) {
EntityPlayerMP player = (EntityPlayerMP) entity;
if (entity instanceof PlayerEntity) {
ServerPlayerEntity player = (ServerPlayerEntity) entity;
player.setPositionAndUpdate(x + 0.5, y + 0.5, z + 0.5);
player.getEntityWorld().updateEntityWithOptionalForce(player, false);
player.connection.sendPacket(new SPacketUpdateHealth(player.getHealth(), player.getFoodStats().getFoodLevel(), player.getFoodStats().getSaturationLevel()));
player.connection.sendPacket(new SUpdateHealthPacket(player.getHealth(), player.getFoodStats().getFoodLevel(), player.getFoodStats().getSaturationLevel()));
} else {
WorldServer worldServer = (WorldServer) entity.getEntityWorld();
ServerWorld worldServer = (ServerWorld) entity.getEntityWorld();
entity.setPosition(x + 0.5, y + 0.5, z + 0.5);
worldServer.resetUpdateEntityTick();
@ -71,12 +71,12 @@ public class AlchemyArrayEffectTeleport extends AlchemyArrayEffect {
}
@Override
public void writeToNBT(NBTTagCompound tag) {
public void writeToNBT(CompoundNBT tag) {
}
@Override
public void readFromNBT(NBTTagCompound tag) {
public void readFromNBT(CompoundNBT tag) {
}

View file

@ -2,9 +2,9 @@ package WayofTime.bloodmagic.alchemyArray;
import WayofTime.bloodmagic.iface.IAlchemyArray;
import WayofTime.bloodmagic.tile.TileAlchemyArray;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -20,7 +20,7 @@ public class AlchemyArrayEffectUpdraft extends AlchemyArrayEffect {
}
@Override
public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, IBlockState state, Entity entity) {
public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, BlockState state, Entity entity) {
double motionY = 1;
double motionYGlowstoneMod = 0.1;
double motionYFeatherMod = 0.05;
@ -34,12 +34,12 @@ public class AlchemyArrayEffectUpdraft extends AlchemyArrayEffect {
}
@Override
public void writeToNBT(NBTTagCompound tag) {
public void writeToNBT(CompoundNBT tag) {
}
@Override
public void readFromNBT(NBTTagCompound tag) {
public void readFromNBT(CompoundNBT tag) {
}

View file

@ -7,7 +7,7 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
public class AlchemyCircleRenderer {
@ -86,8 +86,8 @@ public class AlchemyCircleRenderer {
GlStateManager.translate(x, y, z);
// Specify which face this "circle" is located on
EnumFacing sideHit = EnumFacing.UP;
EnumFacing rotation = tileArray.getRotation();
Direction sideHit = Direction.UP;
Direction rotation = tileArray.getRotation();
GlStateManager.translate(sideHit.getXOffset() * offsetFromFace, sideHit.getYOffset() * offsetFromFace, sideHit.getZOffset() * offsetFromFace);

View file

@ -3,8 +3,8 @@ package WayofTime.bloodmagic.altar;
import WayofTime.bloodmagic.api.impl.BloodMagicAPI;
import WayofTime.bloodmagic.block.BlockBloodRune;
import WayofTime.bloodmagic.tile.TileAltar;
import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -26,7 +26,7 @@ public class AltarUtil {
for (AltarTier tier : AltarTier.values()) {
for (AltarComponent component : tier.getAltarComponents()) {
BlockPos componentPos = pos.add(component.getOffset());
IBlockState worldState = world.getBlockState(componentPos);
BlockState worldState = world.getBlockState(componentPos);
if (worldState.getBlock() instanceof IAltarComponent)
if (((IAltarComponent) worldState.getBlock()).getType(world, worldState, componentPos) == component.getComponent())
@ -35,7 +35,7 @@ public class AltarUtil {
if (component.getComponent() == ComponentType.NOTAIR && worldState.getMaterial() != Material.AIR && !worldState.getMaterial().isLiquid())
continue;
List<IBlockState> validStates = BloodMagicAPI.INSTANCE.getComponentStates(component.getComponent());
List<BlockState> validStates = BloodMagicAPI.INSTANCE.getComponentStates(component.getComponent());
if (!validStates.contains(worldState))
return lastCheck;
}
@ -55,7 +55,7 @@ public class AltarUtil {
continue;
BlockPos componentPos = pos.add(component.getOffset());
IBlockState state = world.getBlockState(componentPos);
BlockState state = world.getBlockState(componentPos);
if (state.getBlock() instanceof BlockBloodRune)
upgrades.upgrade(((BlockBloodRune) state.getBlock()).getBloodRune(world, componentPos, state));
}
@ -71,11 +71,11 @@ public class AltarUtil {
for (AltarTier tier : AltarTier.values()) {
for (AltarComponent component : tier.getAltarComponents()) {
BlockPos componentPos = pos.add(component.getOffset());
IBlockState worldState = world.getBlockState(componentPos);
BlockState worldState = world.getBlockState(componentPos);
if (component.getComponent() == ComponentType.NOTAIR && worldState.getMaterial() != Material.AIR && !worldState.getMaterial().isLiquid())
continue;
List<IBlockState> validStates = BloodMagicAPI.INSTANCE.getComponentStates(component.getComponent());
List<BlockState> validStates = BloodMagicAPI.INSTANCE.getComponentStates(component.getComponent());
if (!validStates.contains(worldState))
return Pair.of(componentPos, component.getComponent());
}

View file

@ -16,15 +16,15 @@ import WayofTime.bloodmagic.tile.TileAltar;
import WayofTime.bloodmagic.util.Constants;
import WayofTime.bloodmagic.util.helper.NetworkHelper;
import com.google.common.base.Enums;
import net.minecraft.block.BlockRedstoneLight;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.BlockState;
import net.minecraft.block.RedstoneLampBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.Direction;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraft.world.ServerWorld;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
@ -75,7 +75,7 @@ public class BloodAltar implements IFluidHandler {
this.tileAltar = tileAltar;
}
public void readFromNBT(NBTTagCompound tagCompound) {
public void readFromNBT(CompoundNBT tagCompound) {
if (!tagCompound.hasKey(Constants.NBT.EMPTY)) {
FluidStack fluid = FluidStack.loadFluidStackFromNBT(tagCompound);
@ -119,7 +119,7 @@ public class BloodAltar implements IFluidHandler {
currentTierDisplayed = Enums.getIfPresent(AltarTier.class, tagCompound.getString(Constants.NBT.ALTAR_CURRENT_TIER_DISPLAYED)).or(AltarTier.ONE);
}
public void writeToNBT(NBTTagCompound tagCompound) {
public void writeToNBT(CompoundNBT tagCompound) {
if (fluid != null)
fluid.writeToNBT(tagCompound);
@ -213,9 +213,9 @@ public class BloodAltar implements IFluidHandler {
lockdownDuration--;
if (internalCounter % 20 == 0) {
for (EnumFacing facing : EnumFacing.VALUES) {
for (Direction facing : Direction.VALUES) {
BlockPos newPos = pos.offset(facing);
IBlockState block = world.getBlockState(newPos);
BlockState block = world.getBlockState(newPos);
block.getBlock().onNeighborChange(world, newPos, pos);
}
}
@ -244,7 +244,7 @@ public class BloodAltar implements IFluidHandler {
if (internalCounter % 100 == 0 && (this.isActive || this.cooldownAfterCrafting <= 0)) {
/* Redstone Lamp below altar: Switch Off */
IBlockState state = world.getBlockState(pos);
BlockState state = world.getBlockState(pos);
if (state.getValue(BlockAltar.POWERED)) {
world.setBlockState(pos, state.cycleProperty(BlockAltar.POWERED), 3);
world.notifyNeighborsOfStateChange(pos, RegistrarBloodMagicBlocks.ALTAR, false);
@ -301,16 +301,16 @@ public class BloodAltar implements IFluidHandler {
hasOperated = true;
if (internalCounter % 4 == 0 && world instanceof WorldServer) {
WorldServer server = (WorldServer) world;
if (internalCounter % 4 == 0 && world instanceof ServerWorld) {
ServerWorld server = (ServerWorld) world;
server.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5, 1, 0.2, 0, 0.2, 0);
}
} else if (!hasOperated && progress > 0) {
progress = Math.max(0, progress - (int) (efficiencyMultiplier * drainRate));
if (internalCounter % 2 == 0 && world instanceof WorldServer) {
WorldServer server = (WorldServer) world;
if (internalCounter % 2 == 0 && world instanceof ServerWorld) {
ServerWorld server = (ServerWorld) world;
server.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5, 1, 0.1, 0, 0.1, 0);
}
}
@ -324,14 +324,14 @@ public class BloodAltar implements IFluidHandler {
tileAltar.setInventorySlotContents(0, event.getOutput());
progress = 0;
if (world instanceof WorldServer) {
WorldServer server = (WorldServer) world;
if (world instanceof ServerWorld) {
ServerWorld server = (ServerWorld) world;
server.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5, 40, 0.3, 0, 0.3, 0);
}
/* Redstone Lamp below altar: Switch On */
/* Switches on when crafting finishes */
if (world.getBlockState(pos.down()).getBlock() instanceof BlockRedstoneLight) {
if (world.getBlockState(pos.down()).getBlock() instanceof RedstoneLampBlock) {
world.setBlockState(pos, world.getBlockState(pos).cycleProperty(BlockAltar.POWERED), 3);
world.notifyNeighborsOfStateChange(pos, RegistrarBloodMagicBlocks.ALTAR, false);
}
@ -357,8 +357,8 @@ public class BloodAltar implements IFluidHandler {
int drain = NetworkHelper.getSoulNetwork(binding).add(SoulTicket.block(world, pos, liquidDrained), (int) (orb.getCapacity() * this.orbCapacityMultiplier));
fluid.amount = fluid.amount - drain;
if (drain > 0 && internalCounter % 4 == 0 && world instanceof WorldServer) {
WorldServer server = (WorldServer) world;
if (drain > 0 && internalCounter % 4 == 0 && world instanceof ServerWorld) {
ServerWorld server = (ServerWorld) world;
server.spawnParticle(EnumParticleTypes.SPELL_WITCH, pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5, 1, 0, 0, 0, 0.001);
}
}

View file

@ -1,6 +1,6 @@
package WayofTime.bloodmagic.altar;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -8,5 +8,5 @@ import javax.annotation.Nullable;
public interface IAltarComponent {
@Nullable
ComponentType getType(World world, IBlockState state, BlockPos pos);
ComponentType getType(World world, BlockState state, BlockPos pos);
}

View file

@ -5,7 +5,7 @@ import WayofTime.bloodmagic.altar.ComponentType;
import WayofTime.bloodmagic.util.BMLog;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.BlockState;
import javax.annotation.Nonnull;
import java.util.List;
@ -17,7 +17,7 @@ public class BloodMagicAPI implements IBloodMagicAPI {
private final BloodMagicBlacklist blacklist;
private final BloodMagicRecipeRegistrar recipeRegistrar;
private final BloodMagicValueManager valueManager;
private final Multimap<ComponentType, IBlockState> altarComponents;
private final Multimap<ComponentType, BlockState> altarComponents;
public BloodMagicAPI() {
this.blacklist = new BloodMagicBlacklist();
@ -45,7 +45,7 @@ public class BloodMagicAPI implements IBloodMagicAPI {
}
@Override
public void registerAltarComponent(@Nonnull IBlockState state, @Nonnull String componentType) {
public void registerAltarComponent(@Nonnull BlockState state, @Nonnull String componentType) {
ComponentType component = null;
for (ComponentType type : ComponentType.VALUES) {
if (type.name().equalsIgnoreCase(componentType)) {
@ -61,7 +61,7 @@ public class BloodMagicAPI implements IBloodMagicAPI {
}
@Override
public void unregisterAltarComponent(@Nonnull IBlockState state, @Nonnull String componentType) {
public void unregisterAltarComponent(@Nonnull BlockState state, @Nonnull String componentType) {
ComponentType component = null;
for (ComponentType type : ComponentType.VALUES) {
if (type.name().equalsIgnoreCase(componentType)) {
@ -77,7 +77,7 @@ public class BloodMagicAPI implements IBloodMagicAPI {
}
@Nonnull
public List<IBlockState> getComponentStates(ComponentType component) {
return (List<IBlockState>) altarComponents.get(component);
public List<BlockState> getComponentStates(ComponentType component) {
return (List<BlockState>) altarComponents.get(component);
}
}

View file

@ -5,7 +5,7 @@ import WayofTime.bloodmagic.util.BMLog;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.BlockState;
import net.minecraft.util.ResourceLocation;
import javax.annotation.Nonnull;
@ -13,10 +13,10 @@ import java.util.Set;
public class BloodMagicBlacklist implements IBloodMagicBlacklist {
private final Set<IBlockState> teleposer;
private final Set<BlockState> teleposer;
private final Set<ResourceLocation> teleposerEntities;
private final Set<IBlockState> transposition;
private final Set<IBlockState> greenGrove;
private final Set<BlockState> transposition;
private final Set<BlockState> greenGrove;
private final Set<ResourceLocation> sacrifice;
public BloodMagicBlacklist() {
@ -28,7 +28,7 @@ public class BloodMagicBlacklist implements IBloodMagicBlacklist {
}
@Override
public void addTeleposer(@Nonnull IBlockState state) {
public void addTeleposer(@Nonnull BlockState state) {
if (!teleposer.contains(state)) {
BMLog.API_VERBOSE.info("Blacklist: Added {} to the Teleposer blacklist.", state);
teleposer.add(state);
@ -36,7 +36,7 @@ public class BloodMagicBlacklist implements IBloodMagicBlacklist {
}
public void addTeleposer(@Nonnull Block block) {
for (IBlockState state : block.getBlockState().getValidStates())
for (BlockState state : block.getBlockState().getValidStates())
addTeleposer(state);
}
@ -49,7 +49,7 @@ public class BloodMagicBlacklist implements IBloodMagicBlacklist {
}
@Override
public void addTransposition(@Nonnull IBlockState state) {
public void addTransposition(@Nonnull BlockState state) {
if (!transposition.contains(state)) {
BMLog.API_VERBOSE.info("Blacklist: Added {} to the Transposition blacklist.", state);
transposition.add(state);
@ -57,12 +57,12 @@ public class BloodMagicBlacklist implements IBloodMagicBlacklist {
}
public void addTransposition(@Nonnull Block block) {
for (IBlockState state : block.getBlockState().getValidStates())
for (BlockState state : block.getBlockState().getValidStates())
addTransposition(state);
}
@Override
public void addGreenGrove(@Nonnull IBlockState state) {
public void addGreenGrove(@Nonnull BlockState state) {
if (!greenGrove.contains(state)) {
BMLog.API_VERBOSE.info("Blacklist: Added {} to the Green Grove blacklist.", state);
greenGrove.add(state);
@ -70,7 +70,7 @@ public class BloodMagicBlacklist implements IBloodMagicBlacklist {
}
public void addGreenGrove(@Nonnull Block block) {
for (IBlockState state : block.getBlockState().getValidStates())
for (BlockState state : block.getBlockState().getValidStates())
addGreenGrove(state);
}
@ -84,7 +84,7 @@ public class BloodMagicBlacklist implements IBloodMagicBlacklist {
// Internal use getters
public Set<IBlockState> getTeleposer() {
public Set<BlockState> getTeleposer() {
return ImmutableSet.copyOf(teleposer);
}
@ -92,11 +92,11 @@ public class BloodMagicBlacklist implements IBloodMagicBlacklist {
return ImmutableSet.copyOf(teleposerEntities);
}
public Set<IBlockState> getTransposition() {
public Set<BlockState> getTransposition() {
return ImmutableSet.copyOf(transposition);
}
public Set<IBlockState> getGreenGrove() {
public Set<BlockState> getGreenGrove() {
return ImmutableSet.copyOf(greenGrove);
}

View file

@ -17,7 +17,7 @@ import WayofTime.bloodmagic.incense.EnumTranquilityType;
import WayofTime.bloodmagic.incense.TranquilityStack;
import WayofTime.bloodmagic.util.StateUtil;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.block.Blocks;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.registry.EntityEntry;
import net.minecraftforge.fml.common.registry.ForgeRegistries;

View file

@ -7,7 +7,7 @@ import WayofTime.bloodmagic.util.BMLog;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.BlockState;
import net.minecraft.util.ResourceLocation;
import javax.annotation.Nonnull;
@ -16,7 +16,7 @@ import java.util.Map;
public class BloodMagicValueManager implements IBloodMagicValueManager {
private final Map<ResourceLocation, Integer> sacrificial;
private final Map<IBlockState, TranquilityStack> tranquility;
private final Map<BlockState, TranquilityStack> tranquility;
public BloodMagicValueManager() {
this.sacrificial = Maps.newHashMap();
@ -30,7 +30,7 @@ public class BloodMagicValueManager implements IBloodMagicValueManager {
}
@Override
public void setTranquility(@Nonnull IBlockState state, @Nonnull String tranquilityType, double value) {
public void setTranquility(@Nonnull BlockState state, @Nonnull String tranquilityType, double value) {
EnumTranquilityType tranquility = null;
for (EnumTranquilityType type : EnumTranquilityType.values()) {
if (type.name().equalsIgnoreCase(tranquilityType)) {
@ -46,7 +46,7 @@ public class BloodMagicValueManager implements IBloodMagicValueManager {
}
public void setTranquility(Block block, TranquilityStack tranquilityStack) {
for (IBlockState state : block.getBlockState().getValidStates()) {
for (BlockState state : block.getBlockState().getValidStates()) {
BMLog.API_VERBOSE.info("Value Manager: Set tranquility value of {} to {} @ {}", state, tranquilityStack.type, tranquilityStack.value);
tranquility.put(state, tranquilityStack);
}
@ -56,7 +56,7 @@ public class BloodMagicValueManager implements IBloodMagicValueManager {
return ImmutableMap.copyOf(sacrificial);
}
public Map<IBlockState, TranquilityStack> getTranquility() {
public Map<BlockState, TranquilityStack> getTranquility() {
return ImmutableMap.copyOf(tranquility);
}
}

View file

@ -7,17 +7,17 @@ import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
import WayofTime.bloodmagic.tile.TileAlchemyArray;
import WayofTime.bloodmagic.util.Utils;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
@ -41,12 +41,12 @@ public class BlockAlchemyArray extends Block {
}
@Override
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean p_185477_7_) {
public void addCollisionBoxToList(BlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean p_185477_7_) {
// No-op
}
@Override
public void onEntityCollision(World world, BlockPos pos, IBlockState state, Entity entity) {
public void onEntityCollision(World world, BlockPos pos, BlockState state, Entity entity) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileAlchemyArray) {
((TileAlchemyArray) tile).onEntityCollidedWithBlock(state, entity);
@ -54,7 +54,7 @@ public class BlockAlchemyArray extends Block {
}
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess source, BlockPos pos) {
return ARRAY_AABB;
}
@ -65,32 +65,32 @@ public class BlockAlchemyArray extends Block {
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
public boolean isNormalCube(BlockState state, IBlockAccess world, BlockPos pos) {
return false;
}
@Override
public boolean isFullCube(IBlockState state) {
public boolean isFullCube(BlockState state) {
return false;
}
@Override
public boolean causesSuffocation(IBlockState state) {
public boolean causesSuffocation(BlockState state) {
return false;
}
@Override
public boolean isOpaqueCube(IBlockState state) {
public boolean isOpaqueCube(BlockState state) {
return false;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.INVISIBLE;
public BlockRenderType getRenderType(BlockState state) {
return BlockRenderType.INVISIBLE;
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
public boolean onBlockActivated(World world, BlockPos pos, BlockState state, PlayerEntity player, Hand hand, Direction side, float hitX, float hitY, float hitZ) {
TileAlchemyArray array = (TileAlchemyArray) world.getTileEntity(pos);
if (array == null)
@ -135,7 +135,7 @@ public class BlockAlchemyArray extends Block {
}
@Override
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
public ItemStack getPickBlock(BlockState state, RayTraceResult target, World world, BlockPos pos, PlayerEntity player) {
return new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES);
}
@ -145,7 +145,7 @@ public class BlockAlchemyArray extends Block {
}
@Override
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) {
public void breakBlock(World world, BlockPos blockPos, BlockState blockState) {
TileAlchemyArray alchemyArray = (TileAlchemyArray) world.getTileEntity(blockPos);
if (alchemyArray != null)
alchemyArray.dropItems();
@ -154,13 +154,13 @@ public class BlockAlchemyArray extends Block {
}
@Override
public boolean hasTileEntity(IBlockState state) {
public boolean hasTileEntity(BlockState state) {
return true;
}
@Nullable
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(World world, BlockState state) {
return new TileAlchemyArray();
}
}

View file

@ -5,18 +5,18 @@ import WayofTime.bloodmagic.item.block.ItemBlockAlchemyTable;
import WayofTime.bloodmagic.tile.TileAlchemyTable;
import WayofTime.bloodmagic.util.Constants;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItem;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
@ -26,7 +26,7 @@ import javax.annotation.Nullable;
public class BlockAlchemyTable extends Block implements IBMBlock {
public static final PropertyBool INVISIBLE = PropertyBool.create("invisible");
public static final PropertyEnum<EnumFacing> DIRECTION = PropertyEnum.create("direction", EnumFacing.class);
public static final PropertyEnum<Direction> DIRECTION = PropertyEnum.create("direction", Direction.class);
private static final AxisAlignedBB BODY = new AxisAlignedBB(0, 0, 0, 16 / 16F, 13 / 16F, 16 / 16F);
public BlockAlchemyTable() {
@ -42,42 +42,42 @@ public class BlockAlchemyTable extends Block implements IBMBlock {
// setBlockBounds(0.3F, 0F, 0.3F, 0.72F, 1F, 0.72F);
}
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess source, BlockPos pos) {
return BODY;
}
@Override
public boolean isOpaqueCube(IBlockState state) {
public boolean isOpaqueCube(BlockState state) {
return false;
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
public boolean isNormalCube(BlockState state, IBlockAccess world, BlockPos pos) {
return false;
}
@Override
public boolean isFullCube(IBlockState state) {
public boolean isFullCube(BlockState state) {
return false;
}
@Override
public boolean causesSuffocation(IBlockState state) {
public boolean causesSuffocation(BlockState state) {
return false;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.MODEL;
public BlockRenderType getRenderType(BlockState state) {
return BlockRenderType.MODEL;
}
@Override
public boolean canRenderInLayer(IBlockState state, BlockRenderLayer layer) {
public boolean canRenderInLayer(BlockState state, BlockRenderLayer layer) {
return layer == BlockRenderLayer.CUTOUT_MIPPED || layer == BlockRenderLayer.TRANSLUCENT;
}
@Override
public IBlockState getStateFromMeta(int meta) {
public BlockState getStateFromMeta(int meta) {
return this.getDefaultState();
}
@ -85,12 +85,12 @@ public class BlockAlchemyTable extends Block implements IBMBlock {
* Convert the BlockState into the correct metadata value
*/
@Override
public int getMetaFromState(IBlockState state) {
public int getMetaFromState(BlockState state) {
return 0;
}
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
public BlockState getActualState(BlockState state, IBlockAccess world, BlockPos pos) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileAlchemyTable) {
return state.withProperty(INVISIBLE, ((TileAlchemyTable) tile).isInvisible()).withProperty(DIRECTION, ((TileAlchemyTable) tile).getDirection());
@ -105,7 +105,7 @@ public class BlockAlchemyTable extends Block implements IBMBlock {
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
public boolean onBlockActivated(World world, BlockPos pos, BlockState state, PlayerEntity player, Hand hand, Direction side, float hitX, float hitY, float hitZ) {
BlockPos position = pos;
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileAlchemyTable) {
@ -124,7 +124,7 @@ public class BlockAlchemyTable extends Block implements IBMBlock {
}
@Override
public void breakBlock(World world, BlockPos pos, IBlockState blockState) {
public void breakBlock(World world, BlockPos pos, BlockState blockState) {
TileAlchemyTable tile = (TileAlchemyTable) world.getTileEntity(pos);
if (tile != null && !tile.isSlave()) {
tile.dropItems();
@ -134,18 +134,18 @@ public class BlockAlchemyTable extends Block implements IBMBlock {
}
@Override
public boolean hasTileEntity(IBlockState state) {
public boolean hasTileEntity(BlockState state) {
return true;
}
@Nullable
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(World world, BlockState state) {
return new TileAlchemyTable();
}
@Override
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos) {
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos) {
TileAlchemyTable tile = (TileAlchemyTable) world.getTileEntity(pos);
if (tile != null) {
BlockPos connectedPos = tile.getConnectedPos();
@ -158,7 +158,7 @@ public class BlockAlchemyTable extends Block implements IBMBlock {
}
@Override
public ItemBlock getItem() {
public BlockItem getItem() {
return new ItemBlockAlchemyTable(this);
}
}

View file

@ -17,22 +17,22 @@ import WayofTime.bloodmagic.tile.TileAltar;
import WayofTime.bloodmagic.util.Utils;
import WayofTime.bloodmagic.util.helper.NetworkHelper;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import org.apache.commons.lang3.tuple.Pair;
@ -57,17 +57,17 @@ public class BlockAltar extends Block implements IVariantProvider, IDocumentedBl
setHarvestLevel("pickaxe", 1);
}
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess source, BlockPos pos) {
return BODY;
}
@Override
public boolean hasComparatorInputOverride(IBlockState state) {
public boolean hasComparatorInputOverride(BlockState state) {
return true;
}
@Override
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) {
public int getComparatorInputOverride(BlockState state, World world, BlockPos pos) {
if (world.isRemote)
return 0;
@ -102,32 +102,32 @@ public class BlockAltar extends Block implements IVariantProvider, IDocumentedBl
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
public boolean isNormalCube(BlockState state, IBlockAccess world, BlockPos pos) {
return false;
}
@Override
public boolean isOpaqueCube(IBlockState state) {
public boolean isOpaqueCube(BlockState state) {
return false;
}
@Override
public boolean isFullCube(IBlockState state) {
public boolean isFullCube(BlockState state) {
return false;
}
@Override
public boolean causesSuffocation(IBlockState state) {
public boolean causesSuffocation(BlockState state) {
return true;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.MODEL;
public BlockRenderType getRenderType(BlockState state) {
return BlockRenderType.MODEL;
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
public boolean onBlockActivated(World world, BlockPos pos, BlockState state, PlayerEntity player, Hand hand, Direction side, float hitX, float hitY, float hitZ) {
TileAltar altar = (TileAltar) world.getTileEntity(pos);
if (altar == null || player.isSneaking())
@ -150,7 +150,7 @@ public class BlockAltar extends Block implements IVariantProvider, IDocumentedBl
}
@Override
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) {
public void breakBlock(World world, BlockPos blockPos, BlockState blockState) {
TileEntity tile = world.getTileEntity(blockPos);
if (tile instanceof TileAltar)
((TileAltar) tile).dropItems();
@ -159,41 +159,41 @@ public class BlockAltar extends Block implements IVariantProvider, IDocumentedBl
}
@Override
public boolean hasTileEntity(IBlockState state) {
public boolean hasTileEntity(BlockState state) {
return true;
}
@Nullable
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(World world, BlockState state) {
return new TileAltar();
}
// IDocumentedBlock
@Override
public List<ITextComponent> getDocumentation(EntityPlayer player, World world, BlockPos pos, IBlockState state) {
public List<ITextComponent> getDocumentation(PlayerEntity player, World world, BlockPos pos, BlockState state) {
List<ITextComponent> docs = new ArrayList<>();
IBloodAltar altar = ((IBloodAltar) world.getTileEntity(pos));
Pair<BlockPos, ComponentType> missingBlock = AltarUtil.getFirstMissingComponent(world, pos, altar.getTier().toInt());
if (missingBlock != null)
docs.add(new TextComponentTranslation("chat.bloodmagic.altar.nextTier", new TextComponentTranslation(missingBlock.getRight().getKey()), Utils.prettifyBlockPosString(missingBlock.getLeft())));
docs.add(new TranslationTextComponent("chat.bloodmagic.altar.nextTier", new TranslationTextComponent(missingBlock.getRight().getKey()), Utils.prettifyBlockPosString(missingBlock.getLeft())));
return docs;
}
@Override
public ItemBlock getItem() {
return new ItemBlock(this);
public BlockItem getItem() {
return new BlockItem(this);
}
/* Redstone code, taken from BlockLever */
public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
public int getWeakPower(BlockState blockState, IBlockAccess blockAccess, BlockPos pos, Direction side) {
return blockState.getValue(POWERED) ? 15 : 0;
}
public int getStrongPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
public int getStrongPower(BlockState blockState, IBlockAccess blockAccess, BlockPos pos, Direction side) {
if (!blockState.getValue(POWERED)) {
return 0;
} else {
@ -201,15 +201,15 @@ public class BlockAltar extends Block implements IVariantProvider, IDocumentedBl
}
}
public boolean canProvidePower(IBlockState state) {
public boolean canProvidePower(BlockState state) {
return true;
}
public IBlockState getStateFromMeta(int meta) {
public BlockState getStateFromMeta(int meta) {
return this.getDefaultState().withProperty(POWERED, meta > 0);
}
public int getMetaFromState(IBlockState state) {
public int getMetaFromState(BlockState state) {
return state.getValue(POWERED) ? 1 : 0;
}
@ -217,7 +217,7 @@ public class BlockAltar extends Block implements IVariantProvider, IDocumentedBl
return new BlockStateContainer(this, POWERED);
}
public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) {
public BlockState getStateForPlacement(World worldIn, BlockPos pos, Direction facing, float hitX, float hitY, float hitZ, int meta, LivingEntity placer) {
return this.getDefaultState().withProperty(POWERED, false);
}

View file

@ -3,14 +3,14 @@ package WayofTime.bloodmagic.block;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.client.particle.ParticleManager;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumHand;
import net.minecraft.util.Hand;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
@ -32,13 +32,13 @@ public class BlockBloodLight extends Block {
}
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess source, BlockPos pos) {
return AABB;
}
@Nullable
@Override
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) {
public AxisAlignedBB getCollisionBoundingBox(BlockState blockState, IBlockAccess worldIn, BlockPos pos) {
return NULL_AABB;
}
@ -54,27 +54,27 @@ public class BlockBloodLight extends Block {
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
public boolean isNormalCube(BlockState state, IBlockAccess world, BlockPos pos) {
return false;
}
@Override
public boolean isOpaqueCube(IBlockState state) {
public boolean isOpaqueCube(BlockState state) {
return false;
}
@Override
public boolean isFullCube(IBlockState state) {
public boolean isFullCube(BlockState state) {
return false;
}
@Override
public boolean causesSuffocation(IBlockState state) {
public boolean causesSuffocation(BlockState state) {
return false;
}
@Override
public int getLightValue(IBlockState state) {
public int getLightValue(BlockState state) {
return 15;
}
@ -90,12 +90,12 @@ public class BlockBloodLight extends Block {
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
EntityPlayerSP player = Minecraft.getMinecraft().player;
public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random rand) {
ClientPlayerEntity player = Minecraft.getMinecraft().player;
if (rand.nextInt(3) != 0) {
world.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0);
ItemStack heldItem = player.getHeldItem(EnumHand.MAIN_HAND);
ItemStack heldItem = player.getHeldItem(Hand.MAIN_HAND);
if (heldItem.isEmpty() || heldItem.getItem() != RegistrarBloodMagicItems.SIGIL_BLOOD_LIGHT)
return;

View file

@ -5,9 +5,9 @@ import WayofTime.bloodmagic.block.base.BlockEnum;
import WayofTime.bloodmagic.block.enums.BloodRuneType;
import WayofTime.bloodmagic.iface.IBloodRune;
import WayofTime.bloodmagic.util.helper.TextHelper;
import net.minecraft.block.BlockState;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
@ -32,7 +32,7 @@ public class BlockBloodRune extends BlockEnum<BloodRuneType> implements IBloodRu
@Nullable
@Override
public BloodRuneType getBloodRune(IBlockAccess world, BlockPos pos, IBlockState state) {
public BloodRuneType getBloodRune(IBlockAccess world, BlockPos pos, BlockState state) {
return state.getValue(getProperty());
}

View file

@ -6,19 +6,19 @@ import WayofTime.bloodmagic.client.IVariantProvider;
import WayofTime.bloodmagic.item.block.ItemBlockBloodTank;
import WayofTime.bloodmagic.tile.TileBloodTank;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import net.minecraft.block.BlockState;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.block.BlockRenderType;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
@ -49,13 +49,13 @@ public class BlockBloodTank extends BlockInteger implements IVariantProvider, IB
}
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess source, BlockPos pos) {
return BOX;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.MODEL;
public BlockRenderType getRenderType(BlockState state) {
return BlockRenderType.MODEL;
}
@Override
@ -65,28 +65,28 @@ public class BlockBloodTank extends BlockInteger implements IVariantProvider, IB
}
@Override
public boolean isFullCube(IBlockState state) {
public boolean isFullCube(BlockState state) {
return false;
}
@Override
public boolean isOpaqueCube(IBlockState state) {
public boolean isOpaqueCube(BlockState state) {
return false;
}
@Override
public void harvestBlock(World world, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity tile, ItemStack stack) {
public void harvestBlock(World world, PlayerEntity player, BlockPos pos, BlockState state, @Nullable TileEntity tile, ItemStack stack) {
super.harvestBlock(world, player, pos, state, tile, stack);
world.setBlockToAir(pos);
}
@Override
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) {
public boolean removedByPlayer(BlockState state, World world, BlockPos pos, PlayerEntity player, boolean willHarvest) {
return willHarvest || super.removedByPlayer(state, world, pos, player, willHarvest);
}
@Override
public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
public boolean onBlockActivated(World world, BlockPos blockPos, BlockState state, PlayerEntity player, Hand hand, Direction side, float hitX, float hitY, float hitZ) {
boolean success = FluidUtil.interactWithFluidHandler(player, hand, world, blockPos, side);
if (success) {
world.checkLight(blockPos);
@ -99,23 +99,23 @@ public class BlockBloodTank extends BlockInteger implements IVariantProvider, IB
}
@Override
public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player) {
public void onBlockHarvested(World worldIn, BlockPos pos, BlockState state, PlayerEntity player) {
if (!player.capabilities.isCreativeMode)
this.dropBlockAsItem(worldIn, pos, state, 0);
super.onBlockHarvested(worldIn, pos, state, player);
}
@Override
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState blockState, int fortune) {
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, BlockState blockState, int fortune) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileBloodTank) {
TileBloodTank bloodTank = (TileBloodTank) tile;
ItemStack drop = new ItemStack(this, 1, bloodTank.getBlockMetadata());
NBTTagCompound fluidTag = new NBTTagCompound();
CompoundNBT fluidTag = new CompoundNBT();
if (bloodTank.getTank().getFluid() != null) {
bloodTank.getTank().getFluid().writeToNBT(fluidTag);
NBTTagCompound dropTag = new NBTTagCompound();
CompoundNBT dropTag = new CompoundNBT();
dropTag.setTag("Fluid", fluidTag);
drop.setTagCompound(dropTag);
}
@ -125,11 +125,11 @@ public class BlockBloodTank extends BlockInteger implements IVariantProvider, IB
}
@Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState blockState, EntityLivingBase placer, ItemStack stack) {
public void onBlockPlacedBy(World world, BlockPos pos, BlockState blockState, LivingEntity placer, ItemStack stack) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileBloodTank) {
TileBloodTank bloodTank = (TileBloodTank) tile;
NBTTagCompound tag = stack.getTagCompound();
CompoundNBT tag = stack.getTagCompound();
if (stack.hasTagCompound() && stack.getTagCompound().hasKey("Fluid")) {
FluidStack fluidStack = FluidStack.loadFluidStackFromNBT(tag.getCompoundTag("Fluid"));
bloodTank.getTank().setFluid(fluidStack);
@ -142,7 +142,7 @@ public class BlockBloodTank extends BlockInteger implements IVariantProvider, IB
}
@Override
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
public int getLightValue(BlockState state, IBlockAccess world, BlockPos pos) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileBloodTank) {
FluidStack fluidStack = ((TileBloodTank) tile).getTank().getFluid();
@ -153,17 +153,17 @@ public class BlockBloodTank extends BlockInteger implements IVariantProvider, IB
}
@Override
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
public ItemStack getPickBlock(BlockState state, RayTraceResult target, World world, BlockPos pos, PlayerEntity player) {
return new ItemStack(this, 1, getMetaFromState(state));
}
@Override
public boolean hasComparatorInputOverride(IBlockState state) {
public boolean hasComparatorInputOverride(BlockState state) {
return true;
}
@Override
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) {
public int getComparatorInputOverride(BlockState state, World world, BlockPos pos) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileBloodTank)
return ((TileBloodTank) tile).getComparatorOutput();
@ -171,17 +171,17 @@ public class BlockBloodTank extends BlockInteger implements IVariantProvider, IB
}
@Override
public TileEntity createTileEntity(World worldIn, IBlockState blockState) {
public TileEntity createTileEntity(World worldIn, BlockState blockState) {
return new TileBloodTank(getMetaFromState(blockState));
}
@Override
public boolean hasTileEntity(IBlockState state) {
public boolean hasTileEntity(BlockState state) {
return true;
}
@Override
public ItemBlock getItem() {
public BlockItem getItem() {
return new ItemBlockBloodTank(this);
}

View file

@ -6,7 +6,7 @@ import WayofTime.bloodmagic.block.base.BlockEnum;
import WayofTime.bloodmagic.block.enums.EnumDecorative;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
@ -23,7 +23,7 @@ public class BlockDecorative extends BlockEnum<EnumDecorative> {
}
@Override
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> subBlocks) {
public void getSubBlocks(ItemGroup tab, NonNullList<ItemStack> subBlocks) {
for (EnumDecorative type : EnumDecorative.values()) {
if (!ConfigHandler.general.enableTierSixEvenThoughThereIsNoContent && (type == EnumDecorative.CRYSTAL_TILE || type == EnumDecorative.CRYSTAL_BRICK))
continue;

View file

@ -8,16 +8,16 @@ import WayofTime.bloodmagic.tile.TileDemonCrucible;
import WayofTime.bloodmagic.util.Utils;
import com.google.common.collect.Lists;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
@ -58,7 +58,7 @@ public class BlockDemonCrucible extends Block implements IVariantProvider, IBMBl
// setBlockBounds(0.3F, 0F, 0.3F, 0.72F, 1F, 0.72F);
}
private static List<AxisAlignedBB> getCollisionBoxList(IBlockState state) {
private static List<AxisAlignedBB> getCollisionBoxList(BlockState state) {
ArrayList<AxisAlignedBB> collBox = new ArrayList<>(Arrays.asList(ARMS));
collBox.add(BODY);
collBox.addAll(Arrays.asList(FEET));
@ -66,32 +66,32 @@ public class BlockDemonCrucible extends Block implements IVariantProvider, IBMBl
}
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess source, BlockPos pos) {
return BODY;
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
public boolean isNormalCube(BlockState state, IBlockAccess world, BlockPos pos) {
return false;
}
@Override
public boolean isOpaqueCube(IBlockState state) {
public boolean isOpaqueCube(BlockState state) {
return false;
}
@Override
public boolean causesSuffocation(IBlockState state) {
public boolean causesSuffocation(BlockState state) {
return false;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.MODEL;
public BlockRenderType getRenderType(BlockState state) {
return BlockRenderType.MODEL;
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
public boolean onBlockActivated(World world, BlockPos pos, BlockState state, PlayerEntity player, Hand hand, Direction side, float hitX, float hitY, float hitZ) {
ItemStack heldItem = player.getHeldItem(hand);
TileDemonCrucible crucible = (TileDemonCrucible) world.getTileEntity(pos);
@ -111,7 +111,7 @@ public class BlockDemonCrucible extends Block implements IVariantProvider, IBMBl
}
@Override
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) {
public void breakBlock(World world, BlockPos blockPos, BlockState blockState) {
TileDemonCrucible tile = (TileDemonCrucible) world.getTileEntity(blockPos);
if (tile != null)
tile.dropItems();
@ -120,23 +120,23 @@ public class BlockDemonCrucible extends Block implements IVariantProvider, IBMBl
}
@Override
public boolean hasTileEntity(IBlockState state) {
public boolean hasTileEntity(BlockState state) {
return true;
}
@Nullable
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(World world, BlockState state) {
return new TileDemonCrucible();
}
@Override
public ItemBlock getItem() {
return new ItemBlock(this);
public BlockItem getItem() {
return new BlockItem(this);
}
@Override
public RayTraceResult collisionRayTrace(IBlockState blockState, World worldIn, BlockPos pos, Vec3d start, Vec3d end) {
public RayTraceResult collisionRayTrace(BlockState blockState, World worldIn, BlockPos pos, Vec3d start, Vec3d end) {
List<RayTraceResult> list = Lists.newArrayList();
@ -162,7 +162,7 @@ public class BlockDemonCrucible extends Block implements IVariantProvider, IBMBl
}
@Override
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean bool) {
public void addCollisionBoxToList(BlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean bool) {
state = this.getActualState(state, worldIn, pos);
for (AxisAlignedBB axisalignedbb : getCollisionBoxList(state)) {

View file

@ -10,20 +10,20 @@ import WayofTime.bloodmagic.tile.TileDemonCrystal;
import com.google.common.collect.Lists;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemGroup;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
@ -42,8 +42,8 @@ public class BlockDemonCrystal extends Block implements IBMBlock, IVariantProvid
public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 6);
public static final PropertyEnum<EnumDemonWillType> TYPE = PropertyEnum.create("type", EnumDemonWillType.class);
public static final PropertyEnum<EnumFacing> ATTACHED = PropertyEnum.create("attached", EnumFacing.class);
private static final EnumMap<EnumFacing, AxisAlignedBB> bounds = new EnumMap<>(EnumFacing.class);
public static final PropertyEnum<Direction> ATTACHED = PropertyEnum.create("attached", Direction.class);
private static final EnumMap<Direction, AxisAlignedBB> bounds = new EnumMap<>(Direction.class);
// Bounding / Collision boxes
private static final AxisAlignedBB[] UP = {
@ -103,7 +103,7 @@ public class BlockDemonCrystal extends Block implements IBMBlock, IVariantProvid
public BlockDemonCrystal() {
super(Material.ROCK);
this.setDefaultState(this.blockState.getBaseState().withProperty(TYPE, EnumDemonWillType.DEFAULT).withProperty(ATTACHED, EnumFacing.UP));
this.setDefaultState(this.blockState.getBaseState().withProperty(TYPE, EnumDemonWillType.DEFAULT).withProperty(ATTACHED, Direction.UP));
setTranslationKey(BloodMagic.MODID + ".demonCrystal.");
setCreativeTab(BloodMagic.TAB_BM);
@ -137,7 +137,7 @@ public class BlockDemonCrystal extends Block implements IBMBlock, IVariantProvid
}
// collects a sublist from 0 to age for the collision boxes
private static List<AxisAlignedBB> getCollisionBoxList(IBlockState state) {
private static List<AxisAlignedBB> getCollisionBoxList(BlockState state) {
int age = state.getValue(BlockDemonCrystal.AGE) + 1;
switch (state.getValue(BlockDemonCrystal.ATTACHED)) {
case DOWN:
@ -157,7 +157,7 @@ public class BlockDemonCrystal extends Block implements IBMBlock, IVariantProvid
}
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess source, BlockPos pos) {
TileEntity tile = source.getTileEntity(pos);
if (tile != null)
state = getActualState(state, tile.getWorld(), pos);
@ -179,7 +179,7 @@ public class BlockDemonCrystal extends Block implements IBMBlock, IVariantProvid
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
public boolean onBlockActivated(World world, BlockPos pos, BlockState state, PlayerEntity player, Hand hand, Direction side, float hitX, float hitY, float hitZ) {
if (!world.isRemote) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileDemonCrystal) {
@ -207,7 +207,7 @@ public class BlockDemonCrystal extends Block implements IBMBlock, IVariantProvid
}
@Override
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, BlockState state, int fortune) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileDemonCrystal) {
EnumDemonWillType type = state.getValue(TYPE);
@ -218,7 +218,7 @@ public class BlockDemonCrystal extends Block implements IBMBlock, IVariantProvid
}
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
public BlockState getActualState(BlockState state, IBlockAccess world, BlockPos pos) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileDemonCrystal) {
TileDemonCrystal crystal = (TileDemonCrystal) tile;
@ -229,13 +229,13 @@ public class BlockDemonCrystal extends Block implements IBMBlock, IVariantProvid
}
@Override
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos) {
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileDemonCrystal) {
TileDemonCrystal crystal = (TileDemonCrystal) tile;
EnumFacing placement = crystal.getPlacement();
Direction placement = crystal.getPlacement();
BlockPos offsetPos = pos.offset(placement.getOpposite());
IBlockState offsetState = world.getBlockState(offsetPos);
BlockState offsetState = world.getBlockState(offsetPos);
if (!offsetState.isSideSolid(world, offsetPos, placement))
world.destroyBlock(pos, true);
@ -243,62 +243,62 @@ public class BlockDemonCrystal extends Block implements IBMBlock, IVariantProvid
}
@Override
public boolean canPlaceBlockOnSide(World world, BlockPos pos, EnumFacing side) {
public boolean canPlaceBlockOnSide(World world, BlockPos pos, Direction side) {
BlockPos offsetPos = pos.offset(side.getOpposite());
IBlockState offsetState = world.getBlockState(offsetPos);
BlockState offsetState = world.getBlockState(offsetPos);
return offsetState.isSideSolid(world, offsetPos, side) && this.canPlaceBlockAt(world, pos);
}
@Override
public void getSubBlocks(CreativeTabs creativeTabs, NonNullList<ItemStack> list) {
public void getSubBlocks(ItemGroup creativeTabs, NonNullList<ItemStack> list) {
for (EnumDemonWillType willType : EnumDemonWillType.values())
list.add(new ItemStack(this, 1, willType.ordinal()));
}
@Override
public void harvestBlock(World world, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity tile, ItemStack stack) {
public void harvestBlock(World world, PlayerEntity player, BlockPos pos, BlockState state, @Nullable TileEntity tile, ItemStack stack) {
super.harvestBlock(world, player, pos, state, tile, stack);
world.setBlockToAir(pos);
}
@Override
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) {
public boolean removedByPlayer(BlockState state, World world, BlockPos pos, PlayerEntity player, boolean willHarvest) {
return willHarvest || super.removedByPlayer(state, world, pos, player, false);
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
public boolean isNormalCube(BlockState state, IBlockAccess world, BlockPos pos) {
return false;
}
@Override
public boolean isOpaqueCube(IBlockState state) {
public boolean isOpaqueCube(BlockState state) {
return false;
}
@Override
public boolean isFullCube(IBlockState state) {
public boolean isFullCube(BlockState state) {
return false;
}
@Override
public boolean causesSuffocation(IBlockState state) {
public boolean causesSuffocation(BlockState state) {
return false;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.MODEL;
public BlockRenderType getRenderType(BlockState state) {
return BlockRenderType.MODEL;
}
@Override
public IBlockState getStateFromMeta(int meta) {
public BlockState getStateFromMeta(int meta) {
return this.getDefaultState().withProperty(TYPE, EnumDemonWillType.values()[meta]);
}
@Override
public int getMetaFromState(IBlockState state) {
public int getMetaFromState(BlockState state) {
return state.getValue(TYPE).ordinal();
}
@ -309,18 +309,18 @@ public class BlockDemonCrystal extends Block implements IBMBlock, IVariantProvid
}
@Override
public boolean hasTileEntity(IBlockState state) {
public boolean hasTileEntity(BlockState state) {
return true;
}
@Nullable
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(World world, BlockState state) {
return new TileDemonCrystal();
}
@Override
public ItemBlock getItem() {
public BlockItem getItem() {
return new ItemBlockDemonCrystal(this);
}
@ -331,7 +331,7 @@ public class BlockDemonCrystal extends Block implements IBMBlock, IVariantProvid
}
@Override
public RayTraceResult collisionRayTrace(IBlockState blockState, World worldIn, BlockPos pos, Vec3d start, Vec3d end) {
public RayTraceResult collisionRayTrace(BlockState blockState, World worldIn, BlockPos pos, Vec3d start, Vec3d end) {
List<RayTraceResult> list = Lists.newArrayList();
@ -357,7 +357,7 @@ public class BlockDemonCrystal extends Block implements IBMBlock, IVariantProvid
}
@Override
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean bool) {
public void addCollisionBoxToList(BlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean bool) {
state = this.getActualState(state, worldIn, pos);
for (AxisAlignedBB axisalignedbb : getCollisionBoxList(state)) {

View file

@ -4,20 +4,20 @@ import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.client.IVariantProvider;
import WayofTime.bloodmagic.tile.TileDemonCrystallizer;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.BlockState;
import net.minecraft.block.ContainerBlock;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.BlockItem;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.block.BlockRenderType;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import javax.annotation.Nonnull;
public class BlockDemonCrystallizer extends BlockContainer implements IVariantProvider, IBMBlock {
public class BlockDemonCrystallizer extends ContainerBlock implements IVariantProvider, IBMBlock {
public BlockDemonCrystallizer() {
super(Material.ROCK);
@ -31,33 +31,33 @@ public class BlockDemonCrystallizer extends BlockContainer implements IVariantPr
}
@Override
public boolean isSideSolid(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
return side == EnumFacing.UP;
public boolean isSideSolid(BlockState state, IBlockAccess world, BlockPos pos, Direction side) {
return side == Direction.UP;
}
@Override
public boolean isOpaqueCube(IBlockState state) {
public boolean isOpaqueCube(BlockState state) {
return false;
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
public boolean isNormalCube(BlockState state, IBlockAccess world, BlockPos pos) {
return false;
}
@Override
public boolean isFullCube(IBlockState state) {
public boolean isFullCube(BlockState state) {
return false;
}
@Override
public boolean causesSuffocation(IBlockState state) {
public boolean causesSuffocation(BlockState state) {
return false;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.MODEL;
public BlockRenderType getRenderType(BlockState state) {
return BlockRenderType.MODEL;
}
@Override
@ -71,7 +71,7 @@ public class BlockDemonCrystallizer extends BlockContainer implements IVariantPr
}
@Override
public ItemBlock getItem() {
return new ItemBlock(this);
public BlockItem getItem() {
return new BlockItem(this);
}
}

View file

@ -5,7 +5,7 @@ import WayofTime.bloodmagic.block.base.BlockEnumPillar;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Direction;
import net.minecraft.util.IStringSerializable;
import javax.annotation.Nonnull;
@ -24,7 +24,7 @@ public class BlockDemonPillarBase<E extends Enum<E> & IStringSerializable> exten
@Override
public void gatherVariants(@Nonnull Int2ObjectMap<String> variants) {
EnumFacing.Axis[] axis = new EnumFacing.Axis[]{EnumFacing.Axis.Y, EnumFacing.Axis.X, EnumFacing.Axis.Z};
Direction.Axis[] axis = new Direction.Axis[]{Direction.Axis.Y, Direction.Axis.X, Direction.Axis.Z};
for (int i = 0; i < 3; i++)
for (int j = 0; j < this.getTypes().length; j++)

View file

@ -5,7 +5,7 @@ import WayofTime.bloodmagic.block.base.BlockEnumPillarCap;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Direction;
import net.minecraft.util.IStringSerializable;
import javax.annotation.Nonnull;
@ -24,8 +24,8 @@ public class BlockDemonPillarCapBase<E extends Enum<E> & IStringSerializable> ex
@Override
public void gatherVariants(@Nonnull Int2ObjectMap<String> variants) {
for (int i = 0; i < EnumFacing.values().length; i++)
for (int i = 0; i < Direction.values().length; i++)
for (int j = 0; j < this.getTypes().length; j++)
variants.put(i * 2 + j, "facing=" + EnumFacing.values()[i] + ",type=" + this.getTypes()[j]);
variants.put(i * 2 + j, "facing=" + Direction.values()[i] + ",type=" + this.getTypes()[j]);
}
}

View file

@ -4,13 +4,13 @@ import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.client.IVariantProvider;
import WayofTime.bloodmagic.tile.TileDemonPylon;
import com.google.common.collect.Lists;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.BlockState;
import net.minecraft.block.ContainerBlock;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.BlockItem;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.block.BlockRenderType;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
@ -23,7 +23,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class BlockDemonPylon extends BlockContainer implements IBMBlock, IVariantProvider {
public class BlockDemonPylon extends ContainerBlock implements IBMBlock, IVariantProvider {
protected static final AxisAlignedBB BODY = new AxisAlignedBB(2 / 16F, 7 / 16F, 2 / 16F, 14 / 16F, 20 / 16F, 14 / 16F);
private static final AxisAlignedBB[] FEET = {
new AxisAlignedBB(10 / 16F, 0F, 2 / 16F, 14 / 16F, 7 / 16F, 6 / 16F), // NE
@ -45,7 +45,7 @@ public class BlockDemonPylon extends BlockContainer implements IBMBlock, IVarian
// setBlockBounds(0.3F, 0F, 0.3F, 0.72F, 1F, 0.72F);
}
private static List<AxisAlignedBB> getCollisionBoxList(IBlockState state) {
private static List<AxisAlignedBB> getCollisionBoxList(BlockState state) {
ArrayList<AxisAlignedBB> collBox = new ArrayList<>(Arrays.asList(ARMS));
collBox.add(BODY);
collBox.addAll(Arrays.asList(FEET));
@ -53,33 +53,33 @@ public class BlockDemonPylon extends BlockContainer implements IBMBlock, IVarian
}
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess source, BlockPos pos) {
return BODY;
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
public boolean isNormalCube(BlockState state, IBlockAccess world, BlockPos pos) {
return false;
}
@Override
public boolean isOpaqueCube(IBlockState state) {
public boolean isOpaqueCube(BlockState state) {
return false;
}
@Override
public boolean isFullCube(IBlockState state) {
public boolean isFullCube(BlockState state) {
return false;
}
@Override
public boolean causesSuffocation(IBlockState state) {
public boolean causesSuffocation(BlockState state) {
return false;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.MODEL;
public BlockRenderType getRenderType(BlockState state) {
return BlockRenderType.MODEL;
}
@Override
@ -88,12 +88,12 @@ public class BlockDemonPylon extends BlockContainer implements IBMBlock, IVarian
}
@Override
public ItemBlock getItem() {
return new ItemBlock(this);
public BlockItem getItem() {
return new BlockItem(this);
}
@Override
public RayTraceResult collisionRayTrace(IBlockState blockState, World worldIn, BlockPos pos, Vec3d start, Vec3d end) {
public RayTraceResult collisionRayTrace(BlockState blockState, World worldIn, BlockPos pos, Vec3d start, Vec3d end) {
List<RayTraceResult> list = Lists.newArrayList();
@ -119,7 +119,7 @@ public class BlockDemonPylon extends BlockContainer implements IBMBlock, IVarian
}
@Override
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean bool) {
public void addCollisionBoxToList(BlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean bool) {
state = this.getActualState(state, worldIn, pos);
for (AxisAlignedBB axisalignedbb : getCollisionBoxList(state)) {

View file

@ -8,8 +8,8 @@ import WayofTime.bloodmagic.teleport.PortalLocation;
import WayofTime.bloodmagic.teleport.TeleportQueue;
import WayofTime.bloodmagic.teleport.Teleports;
import WayofTime.bloodmagic.tile.TileDimensionalPortal;
import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
@ -39,22 +39,22 @@ public class BlockDimensionalPortal extends BlockInteger {
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
public boolean isNormalCube(BlockState state, IBlockAccess world, BlockPos pos) {
return false;
}
@Override
public boolean isOpaqueCube(IBlockState state) {
public boolean isOpaqueCube(BlockState state) {
return false;
}
@Override
public boolean causesSuffocation(IBlockState state) {
public boolean causesSuffocation(BlockState state) {
return false;
}
@Override
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
public AxisAlignedBB getCollisionBoundingBox(BlockState state, IBlockAccess world, BlockPos pos) {
return null;
}
@ -67,12 +67,12 @@ public class BlockDimensionalPortal extends BlockInteger {
}
@Override
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
public int getLightValue(BlockState state, IBlockAccess world, BlockPos pos) {
return 12;
}
@Override
public void onEntityCollision(World world, BlockPos pos, IBlockState blockState, Entity entity) {
public void onEntityCollision(World world, BlockPos pos, BlockState blockState, Entity entity) {
if (!world.isRemote && world.getTileEntity(pos) instanceof TileDimensionalPortal) {
TileDimensionalPortal tile = (TileDimensionalPortal) world.getTileEntity(pos);
@ -109,7 +109,7 @@ public class BlockDimensionalPortal extends BlockInteger {
}
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess world, BlockPos pos) {
int meta = state.getBlock().getMetaFromState(state);
if (meta == 0) {
return AABB_0;
@ -135,18 +135,18 @@ public class BlockDimensionalPortal extends BlockInteger {
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random rand) {
this.spawnParticles(world, pos.getX(), pos.getY(), pos.getZ());
}
@Override
public boolean hasTileEntity(IBlockState state) {
public boolean hasTileEntity(BlockState state) {
return true;
}
@Nullable
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(World world, BlockState state) {
return new TileDimensionalPortal();
}

View file

@ -4,11 +4,11 @@ import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.client.IVariantProvider;
import WayofTime.bloodmagic.tile.TileIncenseAltar;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.BlockItem;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
@ -30,37 +30,37 @@ public class BlockIncenseAltar extends Block implements IVariantProvider, IBMBlo
}
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess source, BlockPos pos) {
return AABB;
}
@Override
public boolean isOpaqueCube(IBlockState state) {
public boolean isOpaqueCube(BlockState state) {
return false;
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
public boolean isNormalCube(BlockState state, IBlockAccess world, BlockPos pos) {
return false;
}
@Override
public boolean isFullCube(IBlockState state) {
public boolean isFullCube(BlockState state) {
return false;
}
@Override
public boolean causesSuffocation(IBlockState state) {
public boolean causesSuffocation(BlockState state) {
return false;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.MODEL;
public BlockRenderType getRenderType(BlockState state) {
return BlockRenderType.MODEL;
}
@Override
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) {
public void breakBlock(World world, BlockPos blockPos, BlockState blockState) {
TileIncenseAltar TileIncenseAltar = (TileIncenseAltar) world.getTileEntity(blockPos);
if (TileIncenseAltar != null)
TileIncenseAltar.dropItems();
@ -69,18 +69,18 @@ public class BlockIncenseAltar extends Block implements IVariantProvider, IBMBlo
}
@Override
public boolean hasTileEntity(IBlockState state) {
public boolean hasTileEntity(BlockState state) {
return true;
}
@Nullable
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(World world, BlockState state) {
return new TileIncenseAltar();
}
@Override
public ItemBlock getItem() {
return new ItemBlock(this);
public BlockItem getItem() {
return new BlockItem(this);
}
}

View file

@ -3,11 +3,11 @@ package WayofTime.bloodmagic.block;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.util.Constants;
import WayofTime.bloodmagic.tile.routing.TileInputRoutingNode;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -22,7 +22,7 @@ public class BlockInputRoutingNode extends BlockRoutingNode {
@Override
//TODO: Combine BlockInputRoutingNode and BlockInputRoutingNode so they have the same superclass
public void breakBlock(World world, BlockPos pos, IBlockState state) {
public void breakBlock(World world, BlockPos pos, BlockState state) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileInputRoutingNode) {
((TileInputRoutingNode) tile).removeAllConnections();
@ -32,7 +32,7 @@ public class BlockInputRoutingNode extends BlockRoutingNode {
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
public boolean onBlockActivated(World world, BlockPos pos, BlockState state, PlayerEntity player, Hand hand, Direction side, float hitX, float hitY, float hitZ) {
if (world.getTileEntity(pos) instanceof TileInputRoutingNode) {
player.openGui(BloodMagic.instance, Constants.Gui.ROUTING_NODE_GUI, world, pos.getX(), pos.getY(), pos.getZ());
}
@ -41,13 +41,13 @@ public class BlockInputRoutingNode extends BlockRoutingNode {
}
@Override
public boolean hasTileEntity(IBlockState state) {
public boolean hasTileEntity(BlockState state) {
return true;
}
@Nullable
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(World world, BlockState state) {
return new TileInputRoutingNode();
}
}

View file

@ -8,13 +8,12 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.BlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.block.BlockRenderType;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.property.Properties;
public class BlockInversionPillar extends BlockEnum<EnumSubWillType> {
public BlockInversionPillar() {
@ -29,7 +28,7 @@ public class BlockInversionPillar extends BlockEnum<EnumSubWillType> {
}
@Override
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) {
public void breakBlock(World world, BlockPos blockPos, BlockState blockState) {
TileEntity tile = world.getTileEntity(blockPos);
if (tile instanceof TileInversionPillar) {
TileInversionPillar tilePillar = (TileInversionPillar) world.getTileEntity(blockPos);
@ -40,33 +39,33 @@ public class BlockInversionPillar extends BlockEnum<EnumSubWillType> {
}
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
public BlockState getActualState(BlockState state, IBlockAccess world, BlockPos pos) {
return super.getActualState(state, world, pos).withProperty(Properties.StaticProperty, true);
}
@Override
public boolean isOpaqueCube(IBlockState state) {
public boolean isOpaqueCube(BlockState state) {
return false;
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
public boolean isNormalCube(BlockState state, IBlockAccess world, BlockPos pos) {
return false;
}
@Override
public boolean isFullCube(IBlockState state) {
public boolean isFullCube(BlockState state) {
return false;
}
@Override
public boolean causesSuffocation(IBlockState state) {
public boolean causesSuffocation(BlockState state) {
return false;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.MODEL;
public BlockRenderType getRenderType(BlockState state) {
return BlockRenderType.MODEL;
}
@Override
@ -76,12 +75,12 @@ public class BlockInversionPillar extends BlockEnum<EnumSubWillType> {
}
@Override
public boolean hasTileEntity(IBlockState state) {
public boolean hasTileEntity(BlockState state) {
return true;
}
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(World world, BlockState state) {
return new TileInversionPillar(state.getValue(getProperty()).getType());
}

View file

@ -5,10 +5,10 @@ import WayofTime.bloodmagic.block.base.BlockEnum;
import WayofTime.bloodmagic.block.enums.EnumInversionCap;
import WayofTime.bloodmagic.client.IVariantProvider;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
@ -25,28 +25,28 @@ public class BlockInversionPillarEnd extends BlockEnum<EnumInversionCap> impleme
}
@Override
public boolean isOpaqueCube(IBlockState state) {
public boolean isOpaqueCube(BlockState state) {
return false;
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
public boolean isNormalCube(BlockState state, IBlockAccess world, BlockPos pos) {
return false;
}
@Override
public boolean isFullCube(IBlockState state) {
public boolean isFullCube(BlockState state) {
return false;
}
@Override
public boolean causesSuffocation(IBlockState state) {
public boolean causesSuffocation(BlockState state) {
return false;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.MODEL;
public BlockRenderType getRenderType(BlockState state) {
return BlockRenderType.MODEL;
}
@Override

View file

@ -3,7 +3,7 @@ package WayofTime.bloodmagic.block;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.tile.routing.TileItemRoutingNode;
import WayofTime.bloodmagic.tile.routing.TileRoutingNode;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.BlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -18,7 +18,7 @@ public class BlockItemRoutingNode extends BlockRoutingNode {
}
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state) {
public void breakBlock(World world, BlockPos pos, BlockState state) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileRoutingNode) {
((TileRoutingNode) tile).removeAllConnections();
@ -27,13 +27,13 @@ public class BlockItemRoutingNode extends BlockRoutingNode {
}
@Override
public boolean hasTileEntity(IBlockState state) {
public boolean hasTileEntity(BlockState state) {
return true;
}
@Nullable
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(World world, BlockState state) {
return new TileItemRoutingNode();
}
}

View file

@ -2,7 +2,7 @@ package WayofTime.bloodmagic.block;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.tile.routing.TileMasterRoutingNode;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.BlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
@ -20,13 +20,13 @@ public class BlockMasterRoutingNode extends BlockRoutingNode {
}
@Override
public boolean hasTileEntity(IBlockState state) {
public boolean hasTileEntity(BlockState state) {
return true;
}
@Nullable
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(World world, BlockState state) {
return new TileMasterRoutingNode();
}

View file

@ -9,19 +9,18 @@ import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
import WayofTime.bloodmagic.tile.TileMimic;
import WayofTime.bloodmagic.util.Utils;
import WayofTime.bloodmagic.item.block.ItemBlockMimic;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.*;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemBlock;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.block.Blocks;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.block.BlockRenderType;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
@ -48,7 +47,7 @@ public class BlockMimic extends BlockEnum<EnumMimic> implements IAltarComponent
@Nullable
@Override
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
public AxisAlignedBB getCollisionBoundingBox(BlockState state, IBlockAccess world, BlockPos pos) {
switch (this.getMetaFromState(state)) {
case 1:
case 2:
@ -60,7 +59,7 @@ public class BlockMimic extends BlockEnum<EnumMimic> implements IAltarComponent
if (mimicBlock == Blocks.AIR) {
return FULL_BLOCK_AABB;
}
IBlockState mimicState = tileMimic.getReplacedState();
BlockState mimicState = tileMimic.getReplacedState();
if (mimicBlock != this) {
return mimicState.getCollisionBoundingBox(world, pos);
}
@ -76,14 +75,14 @@ public class BlockMimic extends BlockEnum<EnumMimic> implements IAltarComponent
@Override
@SideOnly(Side.CLIENT)
public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World world, BlockPos pos) {
public AxisAlignedBB getSelectedBoundingBox(BlockState state, World world, BlockPos pos) {
TileMimic tileMimic = (TileMimic) world.getTileEntity(pos);
if (tileMimic != null && !tileMimic.getStackInSlot(0).isEmpty()) {
Block mimicBlock = Block.getBlockFromItem(tileMimic.getStackInSlot(0).getItem());
if (mimicBlock == Blocks.AIR) {
return FULL_BLOCK_AABB;
}
IBlockState mimicState = tileMimic.getReplacedState();
BlockState mimicState = tileMimic.getReplacedState();
if (mimicBlock != this) {
return mimicState.getSelectedBoundingBox(world, pos);
}
@ -93,7 +92,7 @@ public class BlockMimic extends BlockEnum<EnumMimic> implements IAltarComponent
}
@Override
public int getLightOpacity(IBlockState state) {
public int getLightOpacity(BlockState state) {
switch (this.getMetaFromState(state)) {
case 2:
case 4:
@ -104,7 +103,7 @@ public class BlockMimic extends BlockEnum<EnumMimic> implements IAltarComponent
}
@Override
public int getLightValue(IBlockState state) {
public int getLightValue(BlockState state) {
switch (this.getMetaFromState(state)) {
case 3:
return 15;
@ -114,7 +113,7 @@ public class BlockMimic extends BlockEnum<EnumMimic> implements IAltarComponent
}
@Override
public int getMetaFromState(IBlockState state) {
public int getMetaFromState(BlockState state) {
if (state.getBlock() == this) {
return super.getMetaFromState(state);
}
@ -123,23 +122,23 @@ public class BlockMimic extends BlockEnum<EnumMimic> implements IAltarComponent
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
public boolean onBlockActivated(World world, BlockPos pos, BlockState state, PlayerEntity player, Hand hand, Direction side, float hitX, float hitY, float hitZ) {
TileMimic mimic = (TileMimic) world.getTileEntity(pos);
return mimic != null && mimic.onBlockActivated(world, pos, state, player, hand, player.getHeldItem(hand), side);
}
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
public BlockState getActualState(BlockState state, IBlockAccess world, BlockPos pos) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileMimic) {
TileMimic mimic = (TileMimic) tile;
ItemStack stack = mimic.getStackInSlot(0);
if (stack.getItem() instanceof ItemBlock) {
Block block = ((ItemBlock) stack.getItem()).getBlock();
IBlockState mimicState = mimic.getReplacedState();
if (stack.getItem() instanceof BlockItem) {
Block block = ((BlockItem) stack.getItem()).getBlock();
BlockState mimicState = mimic.getReplacedState();
if (block != this) {
if (block.getRenderType(mimicState) == EnumBlockRenderType.ENTITYBLOCK_ANIMATED) {
if (block.getRenderType(mimicState) == BlockRenderType.ENTITYBLOCK_ANIMATED) {
return RegistrarBloodMagicBlocks.BLOOD_LIGHT.getDefaultState(); //Small and invisible-ish, basically this is returned in order to not render over the animated block (TESR)
}
@ -151,32 +150,32 @@ public class BlockMimic extends BlockEnum<EnumMimic> implements IAltarComponent
}
@Override
public boolean isFullCube(IBlockState state) {
public boolean isFullCube(BlockState state) {
return false;
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
public boolean isNormalCube(BlockState state, IBlockAccess world, BlockPos pos) {
return false;
}
@Override
public boolean causesSuffocation(IBlockState state) {
public boolean causesSuffocation(BlockState state) {
return false;
}
@Override
public boolean isOpaqueCube(IBlockState state) {
public boolean isOpaqueCube(BlockState state) {
return false;
}
@Override
public boolean canRenderInLayer(IBlockState state, BlockRenderLayer layer) {
public boolean canRenderInLayer(BlockState state, BlockRenderLayer layer) {
return layer == BlockRenderLayer.CUTOUT_MIPPED || layer == BlockRenderLayer.CUTOUT;
}
@Override
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) {
public void breakBlock(World world, BlockPos blockPos, BlockState blockState) {
TileEntity tile = world.getTileEntity(blockPos);
if (tile instanceof TileMimic) {
TileMimic TileMimic = (TileMimic) world.getTileEntity(blockPos);
@ -188,12 +187,12 @@ public class BlockMimic extends BlockEnum<EnumMimic> implements IAltarComponent
}
@Override
public boolean hasTileEntity(IBlockState state) {
public boolean hasTileEntity(BlockState state) {
return true;
}
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(World world, BlockState state) {
return new TileMimic();
}
@ -201,13 +200,13 @@ public class BlockMimic extends BlockEnum<EnumMimic> implements IAltarComponent
@Nullable
@Override
public ComponentType getType(World world, IBlockState state, BlockPos pos) {
public ComponentType getType(World world, BlockState state, BlockPos pos) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileMimic) {
TileMimic mimic = (TileMimic) tile;
ItemStack stack = mimic.getStackInSlot(0);
if (stack.getItem() instanceof ItemBlock) {
Block block = ((ItemBlock) stack.getItem()).getBlock();
if (stack.getItem() instanceof BlockItem) {
Block block = ((BlockItem) stack.getItem()).getBlock();
if (block instanceof IAltarComponent) {
return ((IAltarComponent) block).getType(world, mimic.getReplacedState(), pos);
} else {
@ -221,7 +220,7 @@ public class BlockMimic extends BlockEnum<EnumMimic> implements IAltarComponent
}
@Override
public ItemBlock getItem() {
public BlockItem getItem() {
return new ItemBlockMimic(this);
}

View file

@ -3,11 +3,11 @@ package WayofTime.bloodmagic.block;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.util.Constants;
import WayofTime.bloodmagic.tile.routing.TileOutputRoutingNode;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -22,7 +22,7 @@ public class BlockOutputRoutingNode extends BlockRoutingNode {
@Override
//TODO: Combine BlockOutputRoutingNode and BlockInputRoutingNode so they have the same superclass
public void breakBlock(World world, BlockPos pos, IBlockState state) {
public void breakBlock(World world, BlockPos pos, BlockState state) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileOutputRoutingNode) {
((TileOutputRoutingNode) tile).removeAllConnections();
@ -32,7 +32,7 @@ public class BlockOutputRoutingNode extends BlockRoutingNode {
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
public boolean onBlockActivated(World world, BlockPos pos, BlockState state, PlayerEntity player, Hand hand, Direction side, float hitX, float hitY, float hitZ) {
if (world.getTileEntity(pos) instanceof TileOutputRoutingNode) {
player.openGui(BloodMagic.instance, Constants.Gui.ROUTING_NODE_GUI, world, pos.getX(), pos.getY(), pos.getZ());
}
@ -41,13 +41,13 @@ public class BlockOutputRoutingNode extends BlockRoutingNode {
}
@Override
public boolean hasTileEntity(IBlockState state) {
public boolean hasTileEntity(BlockState state) {
return true;
}
@Nullable
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(World world, BlockState state) {
return new TileOutputRoutingNode();
}
}

View file

@ -5,9 +5,9 @@ import WayofTime.bloodmagic.block.base.BlockEnum;
import WayofTime.bloodmagic.block.enums.EnumPath;
import WayofTime.bloodmagic.incense.IIncensePath;
import WayofTime.bloodmagic.util.helper.TextHelper;
import net.minecraft.block.BlockState;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
@ -45,7 +45,7 @@ public class BlockPath extends BlockEnum<EnumPath> implements IIncensePath {
}
@Override
public Material getMaterial(IBlockState state) {
public Material getMaterial(BlockState state) {
EnumPath path = state.getValue(getProperty());
if (path.equals(EnumPath.WOOD) || path.equals(EnumPath.WOODTILE))
return Material.WOOD;
@ -54,7 +54,7 @@ public class BlockPath extends BlockEnum<EnumPath> implements IIncensePath {
}
@Override
public SoundType getSoundType(IBlockState state, World world, BlockPos pos, @Nullable Entity entity) {
public SoundType getSoundType(BlockState state, World world, BlockPos pos, @Nullable Entity entity) {
EnumPath path = state.getValue(getProperty());
if (path.equals(EnumPath.WOOD) || path.equals(EnumPath.WOODTILE))
return SoundType.WOOD;
@ -63,7 +63,7 @@ public class BlockPath extends BlockEnum<EnumPath> implements IIncensePath {
}
@Override
public int getLevelOfPath(World world, BlockPos pos, IBlockState state) {
public int getLevelOfPath(World world, BlockPos pos, BlockState state) {
switch (this.getMetaFromState(state)) {
case 0:
case 1:

View file

@ -4,12 +4,12 @@ import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.client.IVariantProvider;
import WayofTime.bloodmagic.tile.TilePhantomBlock;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.block.BlockRenderType;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@ -28,28 +28,28 @@ public class BlockPhantom extends Block implements IVariantProvider {
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
public boolean isNormalCube(BlockState state, IBlockAccess world, BlockPos pos) {
return false;
}
@Override
public boolean isOpaqueCube(IBlockState state) {
public boolean isOpaqueCube(BlockState state) {
return false;
}
@Override
public boolean isFullCube(IBlockState state) {
public boolean isFullCube(BlockState state) {
return false;
}
@Override
public boolean causesSuffocation(IBlockState state) {
public boolean causesSuffocation(BlockState state) {
return false;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.MODEL;
public BlockRenderType getRenderType(BlockState state) {
return BlockRenderType.MODEL;
}
@Override
@ -60,7 +60,7 @@ public class BlockPhantom extends Block implements IVariantProvider {
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
public boolean shouldSideBeRendered(BlockState state, IBlockAccess world, BlockPos pos, Direction side) {
return world.getBlockState(pos.offset(side)) != state || state.getBlock() != this && super.shouldSideBeRendered(state, world, pos, side);
}
@ -70,13 +70,13 @@ public class BlockPhantom extends Block implements IVariantProvider {
}
@Override
public boolean hasTileEntity(IBlockState state) {
public boolean hasTileEntity(BlockState state) {
return true;
}
@Nullable
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(World world, BlockState state) {
return new TilePhantomBlock(20);
}
}

View file

@ -13,17 +13,17 @@ import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
import WayofTime.bloodmagic.tile.TileImperfectRitualStone;
import WayofTime.bloodmagic.tile.TileMasterRitualStone;
import amerifrance.guideapi.api.IGuideLinked;
import net.minecraft.block.BlockState;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
@ -44,7 +44,7 @@ public class BlockRitualController extends BlockEnum<EnumRitualController> imple
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
public boolean onBlockActivated(World world, BlockPos pos, BlockState state, PlayerEntity player, Hand hand, Direction side, float hitX, float hitY, float hitZ) {
ItemStack heldItem = player.getHeldItem(hand);
TileEntity tile = world.getTileEntity(pos);
@ -57,7 +57,7 @@ public class BlockRitualController extends BlockEnum<EnumRitualController> imple
if (!key.isEmpty()) {
Ritual ritual = BloodMagic.RITUAL_MANAGER.getRitual(key);
if (ritual != null) {
EnumFacing direction = RitualHelper.getDirectionOfRitual(world, pos, ritual);
Direction direction = RitualHelper.getDirectionOfRitual(world, pos, ritual);
// TODO: Give a message stating that this ritual is not a valid ritual.
if (direction != null && RitualHelper.checkValidRitual(world, pos, ritual, direction)) {
if (((TileMasterRitualStone) tile).activateRitual(heldItem, player, BloodMagic.RITUAL_MANAGER.getRitual(key))) {
@ -66,17 +66,17 @@ public class BlockRitualController extends BlockEnum<EnumRitualController> imple
((TileMasterRitualStone) tile).setInverted(true);
}
} else {
player.sendStatusMessage(new TextComponentTranslation("chat.bloodmagic.ritual.notValid"), true);
player.sendStatusMessage(new TranslationTextComponent("chat.bloodmagic.ritual.notValid"), true);
}
} else {
player.sendStatusMessage(new TextComponentTranslation("chat.bloodmagic.ritual.notValid"), true);
player.sendStatusMessage(new TranslationTextComponent("chat.bloodmagic.ritual.notValid"), true);
}
} else {
player.sendStatusMessage(new TextComponentTranslation("chat.bloodmagic.ritual.notValid"), true);
player.sendStatusMessage(new TranslationTextComponent("chat.bloodmagic.ritual.notValid"), true);
}
}
} else if (state.getValue(getProperty()) == EnumRitualController.IMPERFECT && tile instanceof TileImperfectRitualStone) {
IBlockState ritualBlock = world.getBlockState(pos.up());
BlockState ritualBlock = world.getBlockState(pos.up());
ImperfectRitual ritual = BloodMagic.RITUAL_MANAGER.getImperfectRitual(ritualBlock);
if (ritual == null)
return false;
@ -89,7 +89,7 @@ public class BlockRitualController extends BlockEnum<EnumRitualController> imple
}
@Override
public void onBlockHarvested(World world, BlockPos pos, IBlockState state, EntityPlayer player) {
public void onBlockHarvested(World world, BlockPos pos, BlockState state, PlayerEntity player) {
TileEntity tile = world.getTileEntity(pos);
if (getMetaFromState(state) == 0 && tile instanceof TileMasterRitualStone)
@ -105,12 +105,12 @@ public class BlockRitualController extends BlockEnum<EnumRitualController> imple
}
@Override
public boolean hasTileEntity(IBlockState state) {
public boolean hasTileEntity(BlockState state) {
return true;
}
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(World world, BlockState state) {
return state.getValue(getProperty()) != EnumRitualController.IMPERFECT ? new TileMasterRitualStone() : new TileImperfectRitualStone();
}
@ -118,8 +118,8 @@ public class BlockRitualController extends BlockEnum<EnumRitualController> imple
@Override
@Nullable
public ResourceLocation getLinkedEntry(World world, BlockPos pos, EntityPlayer player, ItemStack stack) {
IBlockState state = world.getBlockState(pos);
public ResourceLocation getLinkedEntry(World world, BlockPos pos, PlayerEntity player, ItemStack stack) {
BlockState state = world.getBlockState(pos);
if (state.getValue(getProperty()).equals(EnumRitualController.MASTER)) {
TileMasterRitualStone mrs = (TileMasterRitualStone) world.getTileEntity(pos);
if (mrs == null || mrs.getCurrentRitual() == null)

View file

@ -8,9 +8,9 @@ import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
import WayofTime.bloodmagic.util.helper.TextHelper;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.BlockState;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -39,12 +39,12 @@ public class BlockRitualStone extends BlockEnum<EnumRuneType> implements IRitual
}
@Override
public int damageDropped(IBlockState state) {
public int damageDropped(BlockState state) {
return 0;
}
@Override
public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player) {
public boolean canSilkHarvest(World world, BlockPos pos, BlockState state, PlayerEntity player) {
return false;
}
@ -56,7 +56,7 @@ public class BlockRitualStone extends BlockEnum<EnumRuneType> implements IRitual
@Override
public void setRuneType(World world, BlockPos pos, EnumRuneType runeType) {
int meta = runeType.ordinal();
IBlockState newState = RegistrarBloodMagicBlocks.RITUAL_STONE.getStateFromMeta(meta);
BlockState newState = RegistrarBloodMagicBlocks.RITUAL_STONE.getStateFromMeta(meta);
world.setBlockState(pos, newState);
}
}

View file

@ -6,15 +6,15 @@ import WayofTime.bloodmagic.tile.routing.TileMasterRoutingNode;
import WayofTime.bloodmagic.tile.routing.TileRoutingNode;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.BlockItem;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Direction;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
@ -43,47 +43,47 @@ public class BlockRoutingNode extends Block implements IBMBlock, IVariantProvide
}
@Override
public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
public boolean canConnectRedstone(BlockState state, IBlockAccess world, BlockPos pos, Direction side) {
return true;
}
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess source, BlockPos pos) {
return AABB;
}
@Override
public boolean isOpaqueCube(IBlockState state) {
public boolean isOpaqueCube(BlockState state) {
return false;
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
public boolean isNormalCube(BlockState state, IBlockAccess world, BlockPos pos) {
return false;
}
@Override
public boolean isFullCube(IBlockState state) {
public boolean isFullCube(BlockState state) {
return false;
}
@Override
public boolean causesSuffocation(IBlockState state) {
public boolean causesSuffocation(BlockState state) {
return false;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.MODEL;
public BlockRenderType getRenderType(BlockState state) {
return BlockRenderType.MODEL;
}
@Override
public boolean canRenderInLayer(IBlockState state, BlockRenderLayer layer) {
public boolean canRenderInLayer(BlockState state, BlockRenderLayer layer) {
return layer == BlockRenderLayer.CUTOUT_MIPPED || layer == BlockRenderLayer.TRANSLUCENT;
}
@Override
public IBlockState getStateFromMeta(int meta) {
public BlockState getStateFromMeta(int meta) {
return this.getDefaultState();
}
@ -91,13 +91,13 @@ public class BlockRoutingNode extends Block implements IBMBlock, IVariantProvide
* Convert the BlockState into the correct metadata value
*/
@Override
public int getMetaFromState(IBlockState state) {
public int getMetaFromState(BlockState state) {
return 0;
}
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
return state.withProperty(UP, this.shouldConnect(state, worldIn, pos.up(), EnumFacing.DOWN)).withProperty(DOWN, this.shouldConnect(state, worldIn, pos.down(), EnumFacing.UP)).withProperty(NORTH, this.shouldConnect(state, worldIn, pos.north(), EnumFacing.SOUTH)).withProperty(EAST, this.shouldConnect(state, worldIn, pos.east(), EnumFacing.WEST)).withProperty(SOUTH, this.shouldConnect(state, worldIn, pos.south(), EnumFacing.NORTH)).withProperty(WEST, this.shouldConnect(state, worldIn, pos.west(), EnumFacing.EAST));
public BlockState getActualState(BlockState state, IBlockAccess worldIn, BlockPos pos) {
return state.withProperty(UP, this.shouldConnect(state, worldIn, pos.up(), Direction.DOWN)).withProperty(DOWN, this.shouldConnect(state, worldIn, pos.down(), Direction.UP)).withProperty(NORTH, this.shouldConnect(state, worldIn, pos.north(), Direction.SOUTH)).withProperty(EAST, this.shouldConnect(state, worldIn, pos.east(), Direction.WEST)).withProperty(SOUTH, this.shouldConnect(state, worldIn, pos.south(), Direction.NORTH)).withProperty(WEST, this.shouldConnect(state, worldIn, pos.west(), Direction.EAST));
}
@Override
@ -105,14 +105,14 @@ public class BlockRoutingNode extends Block implements IBMBlock, IVariantProvide
return new BlockStateContainer(this, UP, DOWN, NORTH, EAST, WEST, SOUTH);
}
public boolean shouldConnect(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing attachedSide) {
IBlockState blockState = world.getBlockState(pos);
public boolean shouldConnect(BlockState state, IBlockAccess world, BlockPos pos, Direction attachedSide) {
BlockState blockState = world.getBlockState(pos);
Block block = blockState.getBlock();
return block.getMaterial(blockState).isOpaque() && blockState.isFullCube();
}
@Override
public void breakBlock(World world, BlockPos pos, IBlockState blockState) {
public void breakBlock(World world, BlockPos pos, BlockState blockState) {
if (!world.isRemote) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileRoutingNode) {
@ -126,8 +126,8 @@ public class BlockRoutingNode extends Block implements IBMBlock, IVariantProvide
}
@Override
public ItemBlock getItem() {
return new ItemBlock(this);
public BlockItem getItem() {
return new BlockItem(this);
}
@Override

View file

@ -5,15 +5,15 @@ import WayofTime.bloodmagic.client.IVariantProvider;
import WayofTime.bloodmagic.tile.TileSoulForge;
import WayofTime.bloodmagic.util.Constants;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItem;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.block.BlockRenderType;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
@ -36,37 +36,37 @@ public class BlockSoulForge extends Block implements IVariantProvider, IBMBlock
}
@Override
public boolean isOpaqueCube(IBlockState state) {
public boolean isOpaqueCube(BlockState state) {
return false;
}
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess source, BlockPos pos) {
return AABB;
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
public boolean isNormalCube(BlockState state, IBlockAccess world, BlockPos pos) {
return false;
}
@Override
public boolean isFullCube(IBlockState state) {
public boolean isFullCube(BlockState state) {
return false;
}
@Override
public boolean causesSuffocation(IBlockState state) {
public boolean causesSuffocation(BlockState state) {
return false;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.MODEL;
public BlockRenderType getRenderType(BlockState state) {
return BlockRenderType.MODEL;
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
public boolean onBlockActivated(World world, BlockPos pos, BlockState state, PlayerEntity player, Hand hand, Direction side, float hitX, float hitY, float hitZ) {
if (world.getTileEntity(pos) instanceof TileSoulForge)
player.openGui(BloodMagic.instance, Constants.Gui.SOUL_FORGE_GUI, world, pos.getX(), pos.getY(), pos.getZ());
@ -74,7 +74,7 @@ public class BlockSoulForge extends Block implements IVariantProvider, IBMBlock
}
@Override
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) {
public void breakBlock(World world, BlockPos blockPos, BlockState blockState) {
TileSoulForge tileSoulForge = (TileSoulForge) world.getTileEntity(blockPos);
if (tileSoulForge != null)
tileSoulForge.dropItems();
@ -83,18 +83,18 @@ public class BlockSoulForge extends Block implements IVariantProvider, IBMBlock
}
@Override
public boolean hasTileEntity(IBlockState state) {
public boolean hasTileEntity(BlockState state) {
return true;
}
@Nullable
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(World world, BlockState state) {
return new TileSoulForge();
}
@Override
public ItemBlock getItem() {
return new ItemBlock(this);
public BlockItem getItem() {
return new BlockItem(this);
}
}

View file

@ -4,13 +4,13 @@ import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.ConfigHandler;
import WayofTime.bloodmagic.tile.TileSpectralBlock;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Direction;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
@ -32,27 +32,27 @@ public class BlockSpectral extends Block {
}
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess source, BlockPos pos) {
return AABB;
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
public boolean isNormalCube(BlockState state, IBlockAccess world, BlockPos pos) {
return false;
}
@Override
public boolean isOpaqueCube(IBlockState state) {
public boolean isOpaqueCube(BlockState state) {
return false;
}
@Override
public boolean isFullCube(IBlockState state) {
public boolean isFullCube(BlockState state) {
return false;
}
@Override
public boolean causesSuffocation(IBlockState state) {
public boolean causesSuffocation(BlockState state) {
return false;
}
@ -63,18 +63,18 @@ public class BlockSpectral extends Block {
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return ConfigHandler.client.invisibleSpectralBlocks ? EnumBlockRenderType.INVISIBLE : EnumBlockRenderType.MODEL;
public BlockRenderType getRenderType(BlockState state) {
return ConfigHandler.client.invisibleSpectralBlocks ? BlockRenderType.INVISIBLE : BlockRenderType.MODEL;
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
public boolean shouldSideBeRendered(BlockState state, IBlockAccess world, BlockPos pos, Direction side) {
return world.getBlockState(pos.offset(side)) != state || state.getBlock() != this && super.shouldSideBeRendered(state, world, pos, side);
}
@Override
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List<AxisAlignedBB> list, Entity collidingEntity, boolean bool) {
public void addCollisionBoxToList(BlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List<AxisAlignedBB> list, Entity collidingEntity, boolean bool) {
}
@Override
@ -88,18 +88,18 @@ public class BlockSpectral extends Block {
}
@Override
public boolean isAir(IBlockState state, IBlockAccess world, BlockPos blockPos) {
public boolean isAir(BlockState state, IBlockAccess world, BlockPos blockPos) {
return true;
}
@Override
public boolean hasTileEntity(IBlockState state) {
public boolean hasTileEntity(BlockState state) {
return true;
}
@Nullable
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(World world, BlockState state) {
return new TileSpectralBlock();
}
}

View file

@ -6,20 +6,20 @@ import WayofTime.bloodmagic.command.sub.SubCommandTeleposer;
import WayofTime.bloodmagic.item.ItemTelepositionFocus;
import WayofTime.bloodmagic.tile.TileTeleposer;
import WayofTime.bloodmagic.util.Constants;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.ContainerBlock;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.block.BlockRenderType;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public class BlockTeleposer extends BlockContainer implements IVariantProvider, IBMBlock {
public class BlockTeleposer extends ContainerBlock implements IVariantProvider, IBMBlock {
public BlockTeleposer() {
super(Material.ROCK);
@ -30,12 +30,12 @@ public class BlockTeleposer extends BlockContainer implements IVariantProvider,
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.MODEL;
public BlockRenderType getRenderType(BlockState state) {
return BlockRenderType.MODEL;
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
public boolean onBlockActivated(World world, BlockPos pos, BlockState state, PlayerEntity player, Hand hand, Direction side, float hitX, float hitY, float hitZ) {
ItemStack playerItem = player.getHeldItem(hand);
if (playerItem.getItem() instanceof ItemTelepositionFocus)
@ -47,7 +47,7 @@ public class BlockTeleposer extends BlockContainer implements IVariantProvider,
}
@Override
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) {
public void breakBlock(World world, BlockPos blockPos, BlockState blockState) {
TileTeleposer tileTeleposer = (TileTeleposer) world.getTileEntity(blockPos);
if (tileTeleposer != null) {
tileTeleposer.dropItems();
@ -63,7 +63,7 @@ public class BlockTeleposer extends BlockContainer implements IVariantProvider,
}
@Override
public ItemBlock getItem() {
return new ItemBlock(this);
public BlockItem getItem() {
return new BlockItem(this);
}
}

View file

@ -1,8 +1,8 @@
package WayofTime.bloodmagic.block;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.BlockItem;
public interface IBMBlock {
ItemBlock getItem();
BlockItem getItem();
}

View file

@ -5,12 +5,12 @@ import WayofTime.bloodmagic.client.IVariantProvider;
import WayofTime.bloodmagic.item.block.base.ItemBlockEnum;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.NonNullList;
@ -46,22 +46,22 @@ public class BlockEnum<E extends Enum<E> & IStringSerializable> extends Block im
}
@Override
public IBlockState getStateFromMeta(int meta) {
public BlockState getStateFromMeta(int meta) {
return getDefaultState().withProperty(property, types[meta]);
}
@Override
public int getMetaFromState(IBlockState state) {
public int getMetaFromState(BlockState state) {
return state.getValue(property).ordinal();
}
@Override
public int damageDropped(IBlockState state) {
public int damageDropped(BlockState state) {
return getMetaFromState(state);
}
@Override
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> subBlocks) {
public void getSubBlocks(ItemGroup tab, NonNullList<ItemStack> subBlocks) {
for (E type : types)
subBlocks.add(new ItemStack(this, 1, type.ordinal()));
}
@ -71,7 +71,7 @@ public class BlockEnum<E extends Enum<E> & IStringSerializable> extends Block im
}
@Override
public ItemBlock getItem() {
public BlockItem getItem() {
return new ItemBlockEnum<>(this);
}

View file

@ -1,15 +1,15 @@
package WayofTime.bloodmagic.block.base;
import net.minecraft.block.BlockRotatedPillar;
import net.minecraft.block.BlockState;
import net.minecraft.block.RotatedPillarBlock;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos;
@ -28,25 +28,25 @@ public class BlockEnumPillar<E extends Enum<E> & IStringSerializable> extends Bl
@Override
protected BlockStateContainer createStateContainer() {
return new BlockStateContainer.Builder(this).add(getProperty(), BlockRotatedPillar.AXIS).build();
return new BlockStateContainer.Builder(this).add(getProperty(), RotatedPillarBlock.AXIS).build();
}
@Override
public IBlockState getStateFromMeta(int meta) {
IBlockState state = getBlockState().getBaseState().withProperty(this.getProperty(), getTypes()[meta % 5]);
public BlockState getStateFromMeta(int meta) {
BlockState state = getBlockState().getBaseState().withProperty(this.getProperty(), getTypes()[meta % 5]);
switch (meta / 5) {
case 0:
state = state.withProperty(BlockRotatedPillar.AXIS, EnumFacing.Axis.Y);
state = state.withProperty(RotatedPillarBlock.AXIS, Direction.Axis.Y);
break;
case 1:
state = state.withProperty(BlockRotatedPillar.AXIS, EnumFacing.Axis.X);
state = state.withProperty(RotatedPillarBlock.AXIS, Direction.Axis.X);
break;
case 2:
state = state.withProperty(BlockRotatedPillar.AXIS, EnumFacing.Axis.Z);
state = state.withProperty(RotatedPillarBlock.AXIS, Direction.Axis.Z);
break;
default:
state.withProperty(BlockRotatedPillar.AXIS, EnumFacing.Axis.Y);
state.withProperty(RotatedPillarBlock.AXIS, Direction.Axis.Y);
break;
}
@ -54,16 +54,16 @@ public class BlockEnumPillar<E extends Enum<E> & IStringSerializable> extends Bl
}
@Override
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
public ItemStack getPickBlock(BlockState state, RayTraceResult target, World world, BlockPos pos, PlayerEntity player) {
return new ItemStack(this, 1, damageDropped(state));
}
@SuppressWarnings("incomplete-switch")
@Override
public int getMetaFromState(IBlockState state) {
public int getMetaFromState(BlockState state) {
int i = ArrayUtils.indexOf(getTypes(), state.getValue(getProperty()));
switch (state.getValue(BlockRotatedPillar.AXIS)) {
switch (state.getValue(RotatedPillarBlock.AXIS)) {
case X:
i = i + 5;
break;
@ -76,10 +76,10 @@ public class BlockEnumPillar<E extends Enum<E> & IStringSerializable> extends Bl
}
@Override
public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) {
IBlockState state = world.getBlockState(pos);
public boolean rotateBlock(World world, BlockPos pos, Direction axis) {
BlockState state = world.getBlockState(pos);
for (IProperty<?> prop : state.getProperties().keySet()) {
if (prop == BlockRotatedPillar.AXIS) {
if (prop == RotatedPillarBlock.AXIS) {
world.setBlockState(pos, state.cycleProperty(prop));
return true;
}
@ -88,15 +88,15 @@ public class BlockEnumPillar<E extends Enum<E> & IStringSerializable> extends Bl
}
@Override
public IBlockState withRotation(IBlockState state, Rotation rot) {
public BlockState withRotation(BlockState state, Rotation rot) {
switch (rot) {
case COUNTERCLOCKWISE_90:
case CLOCKWISE_90:
switch (state.getValue(BlockRotatedPillar.AXIS)) {
switch (state.getValue(RotatedPillarBlock.AXIS)) {
case X:
return state.withProperty(BlockRotatedPillar.AXIS, EnumFacing.Axis.Z);
return state.withProperty(RotatedPillarBlock.AXIS, Direction.Axis.Z);
case Z:
return state.withProperty(BlockRotatedPillar.AXIS, EnumFacing.Axis.X);
return state.withProperty(RotatedPillarBlock.AXIS, Direction.Axis.X);
default:
return state;
}
@ -107,18 +107,18 @@ public class BlockEnumPillar<E extends Enum<E> & IStringSerializable> extends Bl
}
@Override
protected ItemStack getSilkTouchDrop(IBlockState state) {
protected ItemStack getSilkTouchDrop(BlockState state) {
return new ItemStack(this, 1, damageDropped(state));
}
@Override
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) {
return super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, hand).withProperty(BlockRotatedPillar.AXIS, facing.getAxis());
public BlockState getStateForPlacement(World world, BlockPos pos, Direction facing, float hitX, float hitY, float hitZ, int meta, LivingEntity placer, Hand hand) {
return super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, hand).withProperty(RotatedPillarBlock.AXIS, facing.getAxis());
}
@Override
public int damageDropped(IBlockState state) {
public int damageDropped(BlockState state) {
return super.getMetaFromState(state);
}
}

View file

@ -1,11 +1,11 @@
package WayofTime.bloodmagic.block.base;
import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
@ -30,44 +30,44 @@ public class BlockEnumPillarCap<E extends Enum<E> & IStringSerializable> extends
}
@Override
public IBlockState getStateFromMeta(int meta) {
IBlockState state = getBlockState().getBaseState().withProperty(this.getProperty(), getTypes()[meta % 2]);
return state.withProperty(FACING, EnumFacing.byIndex(meta / 2));
public BlockState getStateFromMeta(int meta) {
BlockState state = getBlockState().getBaseState().withProperty(this.getProperty(), getTypes()[meta % 2]);
return state.withProperty(FACING, Direction.byIndex(meta / 2));
}
@Override
public int getMetaFromState(IBlockState state) {
public int getMetaFromState(BlockState state) {
int i = ArrayUtils.indexOf(getTypes(), state.getValue(getProperty()));
return i + 2 * state.getValue(FACING).getIndex();
}
@Override
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
public ItemStack getPickBlock(BlockState state, RayTraceResult target, World world, BlockPos pos, PlayerEntity player) {
return new ItemStack(this, 1, damageDropped(state));
}
@Override
public IBlockState withRotation(IBlockState state, Rotation rot) {
public BlockState withRotation(BlockState state, Rotation rot) {
return state.withProperty(FACING, rot.rotate(state.getValue(FACING)));
}
@Override
public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
public BlockState withMirror(BlockState state, Mirror mirrorIn) {
return state.withRotation(mirrorIn.toRotation(state.getValue(FACING)));
}
@Override
protected ItemStack getSilkTouchDrop(IBlockState state) {
protected ItemStack getSilkTouchDrop(BlockState state) {
return new ItemStack(this, 1, damageDropped(state));
}
@Override
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) {
public BlockState getStateForPlacement(World world, BlockPos pos, Direction facing, float hitX, float hitY, float hitZ, int meta, LivingEntity placer, Hand hand) {
return super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, hand).withProperty(FACING, facing);
}
@Override
public int damageDropped(IBlockState state) {
public int damageDropped(BlockState state) {
return super.getMetaFromState(state);
}
}

View file

@ -1,17 +1,17 @@
package WayofTime.bloodmagic.block.base;
import com.google.common.collect.Lists;
import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.BlockStairs;
import net.minecraft.block.BlockStairs.EnumHalf;
import net.minecraft.block.BlockStairs.EnumShape;
import net.minecraft.block.BlockState;
import net.minecraft.block.HorizontalBlock;
import net.minecraft.block.StairsBlock;
import net.minecraft.block.StairsBlock.EnumHalf;
import net.minecraft.block.StairsBlock.EnumShape;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.*;
import net.minecraft.util.math.AxisAlignedBB;
@ -27,7 +27,7 @@ import javax.annotation.Nullable;
import java.util.List;
public class BlockEnumStairs<E extends Enum<E> & IStringSerializable> extends BlockEnum<E> {
public static final PropertyDirection FACING = BlockHorizontal.FACING;
public static final PropertyDirection FACING = HorizontalBlock.FACING;
protected static final AxisAlignedBB AABB_SLAB_TOP = new AxisAlignedBB(0.0D, 0.5D, 0.0D, 1.0D, 1.0D, 1.0D);
protected static final AxisAlignedBB AABB_QTR_TOP_WEST = new AxisAlignedBB(0.0D, 0.5D, 0.0D, 0.5D, 1.0D, 1.0D);
@ -58,11 +58,11 @@ public class BlockEnumStairs<E extends Enum<E> & IStringSerializable> extends Bl
@Override
protected BlockStateContainer createStateContainer() {
return new BlockStateContainer.Builder(this).add(getProperty(), FACING, BlockStairs.HALF, BlockStairs.SHAPE).build();
return new BlockStateContainer.Builder(this).add(getProperty(), FACING, StairsBlock.HALF, StairsBlock.SHAPE).build();
}
@Override
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean bool) {
public void addCollisionBoxToList(BlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean bool) {
state = this.getActualState(state, worldIn, pos);
for (AxisAlignedBB axisalignedbb : getCollisionBoxList(state)) {
@ -71,24 +71,24 @@ public class BlockEnumStairs<E extends Enum<E> & IStringSerializable> extends Bl
}
@Override
public boolean isOpaqueCube(IBlockState state) {
public boolean isOpaqueCube(BlockState state) {
return false;
}
@Override
public boolean isFullCube(IBlockState state) {
public boolean isFullCube(BlockState state) {
return false;
}
@Override
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) {
IBlockState state = super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, hand);
state = state.withProperty(FACING, placer.getHorizontalFacing()).withProperty(BlockStairs.SHAPE, BlockStairs.EnumShape.STRAIGHT);
return facing != EnumFacing.DOWN && (facing == EnumFacing.UP || (double) hitY <= 0.5D) ? state.withProperty(BlockStairs.HALF, BlockStairs.EnumHalf.BOTTOM) : state.withProperty(BlockStairs.HALF, BlockStairs.EnumHalf.TOP);
public BlockState getStateForPlacement(World world, BlockPos pos, Direction facing, float hitX, float hitY, float hitZ, int meta, LivingEntity placer, Hand hand) {
BlockState state = super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, hand);
state = state.withProperty(FACING, placer.getHorizontalFacing()).withProperty(StairsBlock.SHAPE, StairsBlock.EnumShape.STRAIGHT);
return facing != Direction.DOWN && (facing == Direction.UP || (double) hitY <= 0.5D) ? state.withProperty(StairsBlock.HALF, StairsBlock.EnumHalf.BOTTOM) : state.withProperty(StairsBlock.HALF, StairsBlock.EnumHalf.TOP);
}
@Override
public RayTraceResult collisionRayTrace(IBlockState blockState, World worldIn, BlockPos pos, Vec3d start, Vec3d end) {
public RayTraceResult collisionRayTrace(BlockState blockState, World worldIn, BlockPos pos, Vec3d start, Vec3d end) {
List<RayTraceResult> list = Lists.newArrayList();
for (AxisAlignedBB axisalignedbb : getCollisionBoxList(this.getActualState(blockState, worldIn, pos))) {
@ -114,18 +114,18 @@ public class BlockEnumStairs<E extends Enum<E> & IStringSerializable> extends Bl
// Meta looks like: {1|11|1} = {HALF|FACING|TYPE}
@Override
public IBlockState getStateFromMeta(int meta) {
IBlockState state = getBlockState().getBaseState().withProperty(BlockStairs.HALF, (meta & 8) > 0 ? BlockStairs.EnumHalf.TOP : BlockStairs.EnumHalf.BOTTOM);
state = state.withProperty(FACING, EnumFacing.byIndex(5 - (meta & 6) / 2)).withProperty(this.getProperty(), getTypes()[meta % 2]);
public BlockState getStateFromMeta(int meta) {
BlockState state = getBlockState().getBaseState().withProperty(StairsBlock.HALF, (meta & 8) > 0 ? StairsBlock.EnumHalf.TOP : StairsBlock.EnumHalf.BOTTOM);
state = state.withProperty(FACING, Direction.byIndex(5 - (meta & 6) / 2)).withProperty(this.getProperty(), getTypes()[meta % 2]);
return state;
}
// Meta looks like: {1|11|1} = {HALF|FACING|TYPE}
@Override
public int getMetaFromState(IBlockState state) {
public int getMetaFromState(BlockState state) {
int i = 0;
if (state.getValue(BlockStairs.HALF) == BlockStairs.EnumHalf.TOP) {
if (state.getValue(StairsBlock.HALF) == StairsBlock.EnumHalf.TOP) {
i |= 4;
}
@ -134,34 +134,34 @@ public class BlockEnumStairs<E extends Enum<E> & IStringSerializable> extends Bl
}
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
return state.withProperty(BlockStairs.SHAPE, getStairsShape(state, worldIn, pos));
public BlockState getActualState(BlockState state, IBlockAccess worldIn, BlockPos pos) {
return state.withProperty(StairsBlock.SHAPE, getStairsShape(state, worldIn, pos));
}
@Override
public IBlockState withRotation(IBlockState state, Rotation rot) {
public BlockState withRotation(BlockState state, Rotation rot) {
return state.withProperty(FACING, rot.rotate(state.getValue(FACING)));
}
@SuppressWarnings("incomplete-switch")
@Override
public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
EnumFacing facing = state.getValue(FACING);
BlockStairs.EnumShape stairShape = state.getValue(BlockStairs.SHAPE);
public BlockState withMirror(BlockState state, Mirror mirrorIn) {
Direction facing = state.getValue(FACING);
StairsBlock.EnumShape stairShape = state.getValue(StairsBlock.SHAPE);
switch (mirrorIn) {
case LEFT_RIGHT:
if (facing.getAxis() == EnumFacing.Axis.Z) {
if (facing.getAxis() == Direction.Axis.Z) {
switch (stairShape) {
case OUTER_LEFT:
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(BlockStairs.SHAPE, BlockStairs.EnumShape.OUTER_RIGHT);
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(StairsBlock.SHAPE, StairsBlock.EnumShape.OUTER_RIGHT);
case OUTER_RIGHT:
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(BlockStairs.SHAPE, BlockStairs.EnumShape.OUTER_LEFT);
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(StairsBlock.SHAPE, StairsBlock.EnumShape.OUTER_LEFT);
case INNER_RIGHT:
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(BlockStairs.SHAPE, BlockStairs.EnumShape.INNER_LEFT);
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(StairsBlock.SHAPE, StairsBlock.EnumShape.INNER_LEFT);
case INNER_LEFT:
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(BlockStairs.SHAPE, BlockStairs.EnumShape.INNER_RIGHT);
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(StairsBlock.SHAPE, StairsBlock.EnumShape.INNER_RIGHT);
default:
return state.withRotation(Rotation.CLOCKWISE_180);
}
@ -170,16 +170,16 @@ public class BlockEnumStairs<E extends Enum<E> & IStringSerializable> extends Bl
break;
case FRONT_BACK:
if (facing.getAxis() == EnumFacing.Axis.X) {
if (facing.getAxis() == Direction.Axis.X) {
switch (stairShape) {
case OUTER_LEFT:
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(BlockStairs.SHAPE, BlockStairs.EnumShape.OUTER_RIGHT);
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(StairsBlock.SHAPE, StairsBlock.EnumShape.OUTER_RIGHT);
case OUTER_RIGHT:
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(BlockStairs.SHAPE, BlockStairs.EnumShape.OUTER_LEFT);
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(StairsBlock.SHAPE, StairsBlock.EnumShape.OUTER_LEFT);
case INNER_RIGHT:
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(BlockStairs.SHAPE, BlockStairs.EnumShape.INNER_RIGHT);
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(StairsBlock.SHAPE, StairsBlock.EnumShape.INNER_RIGHT);
case INNER_LEFT:
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(BlockStairs.SHAPE, BlockStairs.EnumShape.INNER_LEFT);
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(StairsBlock.SHAPE, StairsBlock.EnumShape.INNER_LEFT);
case STRAIGHT:
return state.withRotation(Rotation.CLOCKWISE_180);
}
@ -190,22 +190,22 @@ public class BlockEnumStairs<E extends Enum<E> & IStringSerializable> extends Bl
}
@Override
protected ItemStack getSilkTouchDrop(IBlockState state) {
protected ItemStack getSilkTouchDrop(BlockState state) {
return new ItemStack(this, 1, damageDropped(state));
}
@Override
public int damageDropped(IBlockState state) {
public int damageDropped(BlockState state) {
return super.getMetaFromState(state);
}
@Override
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
public ItemStack getPickBlock(BlockState state, RayTraceResult target, World world, BlockPos pos, PlayerEntity player) {
return new ItemStack(this, 1, damageDropped(state));
}
@Override
public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face) {
public boolean doesSideBlockRendering(BlockState state, IBlockAccess world, BlockPos pos, Direction face) {
if (ForgeModContainer.disableStairSlabCulling)
return super.doesSideBlockRendering(state, world, pos, face);
@ -214,12 +214,12 @@ public class BlockEnumStairs<E extends Enum<E> & IStringSerializable> extends Bl
state = this.getActualState(state, world, pos);
EnumHalf half = state.getValue(BlockStairs.HALF);
EnumFacing side = state.getValue(FACING);
EnumShape shape = state.getValue(BlockStairs.SHAPE);
if (face == EnumFacing.UP)
EnumHalf half = state.getValue(StairsBlock.HALF);
Direction side = state.getValue(FACING);
EnumShape shape = state.getValue(StairsBlock.SHAPE);
if (face == Direction.UP)
return half == EnumHalf.TOP;
if (face == EnumFacing.DOWN)
if (face == Direction.DOWN)
return half == EnumHalf.BOTTOM;
if (shape == EnumShape.OUTER_LEFT || shape == EnumShape.OUTER_RIGHT)
return false;
@ -232,25 +232,25 @@ public class BlockEnumStairs<E extends Enum<E> & IStringSerializable> extends Bl
return false;
}
private static List<AxisAlignedBB> getCollisionBoxList(IBlockState state) {
private static List<AxisAlignedBB> getCollisionBoxList(BlockState state) {
List<AxisAlignedBB> list = Lists.newArrayList();
boolean flag = state.getValue(BlockStairs.HALF) == BlockStairs.EnumHalf.TOP;
boolean flag = state.getValue(StairsBlock.HALF) == StairsBlock.EnumHalf.TOP;
list.add(flag ? AABB_SLAB_TOP : AABB_SLAB_BOTTOM);
BlockStairs.EnumShape stairShape = state.getValue(BlockStairs.SHAPE);
StairsBlock.EnumShape stairShape = state.getValue(StairsBlock.SHAPE);
if (stairShape == BlockStairs.EnumShape.STRAIGHT || stairShape == BlockStairs.EnumShape.INNER_LEFT || stairShape == BlockStairs.EnumShape.INNER_RIGHT) {
if (stairShape == StairsBlock.EnumShape.STRAIGHT || stairShape == StairsBlock.EnumShape.INNER_LEFT || stairShape == StairsBlock.EnumShape.INNER_RIGHT) {
list.add(getCollQuarterBlock(state));
}
if (stairShape != BlockStairs.EnumShape.STRAIGHT) {
if (stairShape != StairsBlock.EnumShape.STRAIGHT) {
list.add(getCollEighthBlock(state));
}
return list;
}
private static AxisAlignedBB getCollQuarterBlock(IBlockState state) {
boolean flag = state.getValue(BlockStairs.HALF) == BlockStairs.EnumHalf.TOP;
private static AxisAlignedBB getCollQuarterBlock(BlockState state) {
boolean flag = state.getValue(StairsBlock.HALF) == StairsBlock.EnumHalf.TOP;
switch (state.getValue(FACING)) {
case NORTH:
@ -265,11 +265,11 @@ public class BlockEnumStairs<E extends Enum<E> & IStringSerializable> extends Bl
}
}
private static AxisAlignedBB getCollEighthBlock(IBlockState state) {
EnumFacing facing = state.getValue(FACING);
EnumFacing newFacing;
private static AxisAlignedBB getCollEighthBlock(BlockState state) {
Direction facing = state.getValue(FACING);
Direction newFacing;
switch (state.getValue(BlockStairs.SHAPE)) {
switch (state.getValue(StairsBlock.SHAPE)) {
case OUTER_LEFT:
default:
newFacing = facing;
@ -284,7 +284,7 @@ public class BlockEnumStairs<E extends Enum<E> & IStringSerializable> extends Bl
newFacing = facing.rotateYCCW();
}
boolean isTop = state.getValue(BlockStairs.HALF) == BlockStairs.EnumHalf.TOP;
boolean isTop = state.getValue(StairsBlock.HALF) == StairsBlock.EnumHalf.TOP;
switch (newFacing) {
case NORTH:
@ -299,45 +299,45 @@ public class BlockEnumStairs<E extends Enum<E> & IStringSerializable> extends Bl
}
}
private static BlockStairs.EnumShape getStairsShape(IBlockState state, IBlockAccess world, BlockPos pos) {
EnumFacing facing = state.getValue(FACING);
IBlockState offsetState = world.getBlockState(pos.offset(facing));
private static StairsBlock.EnumShape getStairsShape(BlockState state, IBlockAccess world, BlockPos pos) {
Direction facing = state.getValue(FACING);
BlockState offsetState = world.getBlockState(pos.offset(facing));
if (isBlockStairs(offsetState) && state.getValue(BlockStairs.HALF) == offsetState.getValue(BlockStairs.HALF)) {
EnumFacing offsetFacing = offsetState.getValue(FACING);
if (isBlockStairs(offsetState) && state.getValue(StairsBlock.HALF) == offsetState.getValue(StairsBlock.HALF)) {
Direction offsetFacing = offsetState.getValue(FACING);
if (offsetFacing.getAxis() != state.getValue(FACING).getAxis() && isDifferentStairs(state, world, pos, offsetFacing.getOpposite())) {
if (offsetFacing == facing.rotateYCCW()) {
return BlockStairs.EnumShape.OUTER_LEFT;
return StairsBlock.EnumShape.OUTER_LEFT;
}
return BlockStairs.EnumShape.OUTER_RIGHT;
return StairsBlock.EnumShape.OUTER_RIGHT;
}
}
IBlockState oppositeOffsetState = world.getBlockState(pos.offset(facing.getOpposite()));
BlockState oppositeOffsetState = world.getBlockState(pos.offset(facing.getOpposite()));
if (isBlockStairs(oppositeOffsetState) && state.getValue(BlockStairs.HALF) == oppositeOffsetState.getValue(BlockStairs.HALF)) {
EnumFacing oppositeOffsetFacing = oppositeOffsetState.getValue(FACING);
if (isBlockStairs(oppositeOffsetState) && state.getValue(StairsBlock.HALF) == oppositeOffsetState.getValue(StairsBlock.HALF)) {
Direction oppositeOffsetFacing = oppositeOffsetState.getValue(FACING);
if (oppositeOffsetFacing.getAxis() != (state.getValue(FACING)).getAxis() && isDifferentStairs(state, world, pos, oppositeOffsetFacing)) {
if (oppositeOffsetFacing == facing.rotateYCCW()) {
return BlockStairs.EnumShape.INNER_LEFT;
return StairsBlock.EnumShape.INNER_LEFT;
}
return BlockStairs.EnumShape.INNER_RIGHT;
return StairsBlock.EnumShape.INNER_RIGHT;
}
}
return BlockStairs.EnumShape.STRAIGHT;
return StairsBlock.EnumShape.STRAIGHT;
}
private static boolean isDifferentStairs(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing facing) {
IBlockState offsetState = world.getBlockState(pos.offset(facing));
return !isBlockStairs(offsetState) || offsetState.getValue(FACING) != state.getValue(FACING) || offsetState.getValue(BlockStairs.HALF) != state.getValue(BlockStairs.HALF);
private static boolean isDifferentStairs(BlockState state, IBlockAccess world, BlockPos pos, Direction facing) {
BlockState offsetState = world.getBlockState(pos.offset(facing));
return !isBlockStairs(offsetState) || offsetState.getValue(FACING) != state.getValue(FACING) || offsetState.getValue(StairsBlock.HALF) != state.getValue(StairsBlock.HALF);
}
public static boolean isBlockStairs(IBlockState state) {
return state.getBlock() instanceof BlockStairs || state.getBlock() instanceof BlockEnumStairs;
public static boolean isBlockStairs(BlockState state) {
return state.getBlock() instanceof StairsBlock || state.getBlock() instanceof BlockEnumStairs;
}
}

View file

@ -1,14 +1,14 @@
package WayofTime.bloodmagic.block.base;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFenceGate;
import net.minecraft.block.BlockState;
import net.minecraft.block.FenceGateBlock;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.block.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Direction;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
@ -42,18 +42,18 @@ public class BlockEnumWall<E extends Enum<E> & IStringSerializable> extends Bloc
}
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess source, BlockPos pos) {
state = state.getActualState(source, pos);
return AABB_BY_INDEX[getAABBIndex(state)];
}
@Override
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) {
public AxisAlignedBB getCollisionBoundingBox(BlockState blockState, IBlockAccess worldIn, BlockPos pos) {
blockState = blockState.getActualState(worldIn, pos);
return CLIP_AABB_BY_INDEX[getAABBIndex(blockState)];
}
public boolean isFullCube(IBlockState state) {
public boolean isFullCube(BlockState state) {
return false;
}
@ -62,24 +62,24 @@ public class BlockEnumWall<E extends Enum<E> & IStringSerializable> extends Bloc
}
@Override
public boolean isOpaqueCube(IBlockState state) {
public boolean isOpaqueCube(BlockState state) {
return false;
}
private boolean canConnectTo(IBlockAccess worldIn, BlockPos pos) {
IBlockState worldState = worldIn.getBlockState(pos);
BlockState worldState = worldIn.getBlockState(pos);
Block block = worldState.getBlock();
return block != Blocks.BARRIER && (!(block != this && !(block instanceof BlockFenceGate)) || ((worldState.getMaterial().isOpaque() && worldState.isFullCube()) && worldState.getMaterial() != Material.GOURD));
return block != Blocks.BARRIER && (!(block != this && !(block instanceof FenceGateBlock)) || ((worldState.getMaterial().isOpaque() && worldState.isFullCube()) && worldState.getMaterial() != Material.GOURD));
}
@SideOnly(Side.CLIENT)
@Override
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
return side != EnumFacing.DOWN || super.shouldSideBeRendered(blockState, blockAccess, pos, side);
public boolean shouldSideBeRendered(BlockState blockState, IBlockAccess blockAccess, BlockPos pos, Direction side) {
return side != Direction.DOWN || super.shouldSideBeRendered(blockState, blockAccess, pos, side);
}
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
public BlockState getActualState(BlockState state, IBlockAccess worldIn, BlockPos pos) {
boolean canNorth = this.canConnectTo(worldIn, pos.north());
boolean canEast = this.canConnectTo(worldIn, pos.east());
boolean canSouth = this.canConnectTo(worldIn, pos.south());
@ -89,32 +89,32 @@ public class BlockEnumWall<E extends Enum<E> & IStringSerializable> extends Bloc
}
@Override
protected ItemStack getSilkTouchDrop(IBlockState state) {
protected ItemStack getSilkTouchDrop(BlockState state) {
return new ItemStack(this, 1, damageDropped(state));
}
@Override
public int damageDropped(IBlockState state) {
public int damageDropped(BlockState state) {
return super.getMetaFromState(state);
}
private static int getAABBIndex(IBlockState state) {
private static int getAABBIndex(BlockState state) {
int i = 0;
if (state.getValue(NORTH)) {
i |= 1 << EnumFacing.NORTH.getHorizontalIndex();
i |= 1 << Direction.NORTH.getHorizontalIndex();
}
if (state.getValue(EAST)) {
i |= 1 << EnumFacing.EAST.getHorizontalIndex();
i |= 1 << Direction.EAST.getHorizontalIndex();
}
if (state.getValue(SOUTH)) {
i |= 1 << EnumFacing.SOUTH.getHorizontalIndex();
i |= 1 << Direction.SOUTH.getHorizontalIndex();
}
if (state.getValue(WEST)) {
i |= 1 << EnumFacing.WEST.getHorizontalIndex();
i |= 1 << Direction.WEST.getHorizontalIndex();
}
return i;

View file

@ -4,8 +4,8 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.block.BlockState;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
@ -43,22 +43,22 @@ public class BlockInteger extends Block {
}
@Override
public IBlockState getStateFromMeta(int meta) {
public BlockState getStateFromMeta(int meta) {
return getDefaultState().withProperty(property, meta);
}
@Override
public int getMetaFromState(IBlockState state) {
public int getMetaFromState(BlockState state) {
return state.getValue(property);
}
@Override
public int damageDropped(IBlockState state) {
public int damageDropped(BlockState state) {
return getMetaFromState(state);
}
@Override
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> subBlocks) {
public void getSubBlocks(ItemGroup tab, NonNullList<ItemStack> subBlocks) {
for (int i = 0; i < maxMeta; i++)
subBlocks.add(new ItemStack(this, 1, i));
}

View file

@ -4,20 +4,20 @@ import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.tile.TileAlchemyTable;
import WayofTime.bloodmagic.tile.container.ContainerAlchemyTable;
import WayofTime.bloodmagic.util.helper.TextHelper;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.inventory.container.Slot;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiAlchemyTable extends GuiContainer {
public class GuiAlchemyTable extends ContainerScreen {
public IInventory tileTable;
public GuiAlchemyTable(InventoryPlayer playerInventory, IInventory tileTable) {
public GuiAlchemyTable(PlayerInventory playerInventory, IInventory tileTable) {
super(new ContainerAlchemyTable(playerInventory, tileTable));
this.tileTable = tileTable;
this.xSize = 176;

View file

@ -5,7 +5,7 @@ import WayofTime.bloodmagic.ConfigHandler;
import WayofTime.bloodmagic.client.hud.ConfigEntryEditHUD;
import com.google.common.collect.Lists;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraftforge.common.config.ConfigElement;
import net.minecraftforge.fml.client.IModGuiFactory;
import net.minecraftforge.fml.client.config.DummyConfigElement;
@ -18,7 +18,7 @@ import java.util.Set;
public class GuiBloodMagicConfig extends GuiConfig {
public GuiBloodMagicConfig(GuiScreen parentScreen) {
public GuiBloodMagicConfig(Screen parentScreen) {
super(parentScreen, getElements(), BloodMagic.MODID, false, false, BloodMagic.NAME);
}
@ -52,7 +52,7 @@ public class GuiBloodMagicConfig extends GuiConfig {
}
@Override
public GuiScreen createConfigGui(GuiScreen parentScreen) {
public Screen createConfigGui(Screen parentScreen) {
return new GuiBloodMagicConfig(parentScreen);
}

View file

@ -9,15 +9,15 @@ import WayofTime.bloodmagic.tile.TileTeleposer;
import WayofTime.bloodmagic.tile.container.*;
import WayofTime.bloodmagic.tile.routing.TileFilteredRoutingNode;
import WayofTime.bloodmagic.tile.routing.TileMasterRoutingNode;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;
public class GuiHandler implements IGuiHandler {
@Override
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
public Object getServerGuiElement(int id, PlayerEntity player, World world, int x, int y, int z) {
BlockPos pos = new BlockPos(x, y, z);
switch (id) {
@ -39,8 +39,8 @@ public class GuiHandler implements IGuiHandler {
}
@Override
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
if (world instanceof WorldClient) {
public Object getClientGuiElement(int id, PlayerEntity player, World world, int x, int y, int z) {
if (world instanceof ClientWorld) {
BlockPos pos = new BlockPos(x, y, z);
switch (id) {

View file

@ -6,21 +6,21 @@ import WayofTime.bloodmagic.item.inventory.ContainerHolding;
import WayofTime.bloodmagic.item.inventory.InventoryHolding;
import WayofTime.bloodmagic.item.sigil.ItemSigilHolding;
import WayofTime.bloodmagic.util.helper.TextHelper;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumHand;
import net.minecraft.util.Hand;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiHolding extends GuiContainer {
public class GuiHolding extends ContainerScreen {
private ResourceLocation texture = new ResourceLocation(BloodMagic.MODID, "gui/SigilHolding.png");
private EntityPlayer player;
private PlayerEntity player;
public GuiHolding(EntityPlayer player, InventoryHolding inventoryHolding) {
public GuiHolding(PlayerEntity player, InventoryHolding inventoryHolding) {
super(new ContainerHolding(player, inventoryHolding));
xSize = 176;
ySize = 121;
@ -48,7 +48,7 @@ public class GuiHolding extends GuiContainer {
int x = (width - xSize) / 2;
int y = (height - ySize) / 2;
this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
ItemStack held = player.getHeldItem(EnumHand.MAIN_HAND);
ItemStack held = player.getHeldItem(Hand.MAIN_HAND);
if (!held.isEmpty() && held.getItem() == RegistrarBloodMagicItems.SIGIL_HOLDING) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.drawTexturedModalRect(4 + x + 36 * ItemSigilHolding.getCurrentItemOrdinal(player.getHeldItemMainhand()), y + 13, 0, 123, 24, 24);

View file

@ -8,15 +8,15 @@ import WayofTime.bloodmagic.tile.container.ContainerItemRoutingNode;
import WayofTime.bloodmagic.tile.routing.TileFilteredRoutingNode;
import WayofTime.bloodmagic.util.GhostItemHelper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
import net.minecraft.client.gui.widget.TextFieldWidget;
import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@ -24,15 +24,15 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import java.io.IOException;
@SideOnly(Side.CLIENT)
public class GuiItemRoutingNode extends GuiContainer {
private GuiTextField textBox;
public class GuiItemRoutingNode extends ContainerScreen {
private TextFieldWidget textBox;
private TileFilteredRoutingNode inventory;
private ContainerItemRoutingNode container;
private int left, top;
public GuiItemRoutingNode(InventoryPlayer playerInventory, IInventory tileRoutingNode) {
public GuiItemRoutingNode(PlayerInventory playerInventory, IInventory tileRoutingNode) {
super(new ContainerItemRoutingNode(playerInventory, tileRoutingNode));
this.xSize = 201;
this.ySize = 169;
@ -41,7 +41,7 @@ public class GuiItemRoutingNode extends GuiContainer {
}
private int getCurrentActiveSlotPriority() {
EnumFacing direction = EnumFacing.byIndex(inventory.currentActiveSlot);
Direction direction = Direction.byIndex(inventory.currentActiveSlot);
if (direction != null) {
return inventory.getPriority(direction);
}
@ -56,17 +56,17 @@ public class GuiItemRoutingNode extends GuiContainer {
top = (this.height - this.ySize) / 2;
this.buttonList.clear();
this.buttonList.add(new GuiButton(0, left + 176, top + 14, 18, 18, "D"));
this.buttonList.add(new GuiButton(1, left + 176, top + 32, 18, 18, "U"));
this.buttonList.add(new GuiButton(2, left + 176, top + 50, 18, 18, "N"));
this.buttonList.add(new GuiButton(3, left + 176, top + 68, 18, 18, "S"));
this.buttonList.add(new GuiButton(4, left + 176, top + 86, 18, 18, "W"));
this.buttonList.add(new GuiButton(5, left + 176, top + 104, 18, 18, "E"));
this.buttonList.add(new GuiButton(6, left + 160, top + 50, 10, 18, ">"));
this.buttonList.add(new GuiButton(7, left + 132, top + 50, 10, 18, "<"));
this.buttonList.add(new Button(0, left + 176, top + 14, 18, 18, "D"));
this.buttonList.add(new Button(1, left + 176, top + 32, 18, 18, "U"));
this.buttonList.add(new Button(2, left + 176, top + 50, 18, 18, "N"));
this.buttonList.add(new Button(3, left + 176, top + 68, 18, 18, "S"));
this.buttonList.add(new Button(4, left + 176, top + 86, 18, 18, "W"));
this.buttonList.add(new Button(5, left + 176, top + 104, 18, 18, "E"));
this.buttonList.add(new Button(6, left + 160, top + 50, 10, 18, ">"));
this.buttonList.add(new Button(7, left + 132, top + 50, 10, 18, "<"));
disableDirectionalButton(inventory.currentActiveSlot);
this.textBox = new GuiTextField(0, this.fontRenderer, left + 94, top + 37, 70, 12);
this.textBox = new TextFieldWidget(0, this.fontRenderer, left + 94, top + 37, 70, 12);
this.textBox.setEnableBackgroundDrawing(false);
this.textBox.setText("");
}
@ -137,7 +137,7 @@ public class GuiItemRoutingNode extends GuiContainer {
* for buttons)
*/
@Override
protected void actionPerformed(GuiButton button) throws IOException {
protected void actionPerformed(Button button) throws IOException {
if (button.enabled) {
BloodMagicPacketHandler.INSTANCE.sendToServer(new ItemRouterButtonPacketProcessor(button.id, inventory.getPos(), inventory.getWorld()));
if (button.id < 6) {
@ -149,7 +149,7 @@ public class GuiItemRoutingNode extends GuiContainer {
}
private void enableAllDirectionalButtons() {
for (GuiButton button : this.buttonList) {
for (Button button : this.buttonList) {
button.enabled = true;
}
}

View file

@ -2,18 +2,18 @@ package WayofTime.bloodmagic.client.gui;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.tile.container.ContainerMasterRoutingNode;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IInventory;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiMasterRoutingNode extends GuiContainer {
public class GuiMasterRoutingNode extends ContainerScreen {
public GuiMasterRoutingNode(InventoryPlayer playerInventory, IInventory tileRoutingNode) {
public GuiMasterRoutingNode(PlayerInventory playerInventory, IInventory tileRoutingNode) {
super(new ContainerMasterRoutingNode(playerInventory, tileRoutingNode));
this.xSize = 216;
this.ySize = 216;

View file

@ -4,19 +4,19 @@ import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.tile.TileSoulForge;
import WayofTime.bloodmagic.tile.container.ContainerSoulForge;
import WayofTime.bloodmagic.util.helper.TextHelper;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IInventory;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiSoulForge extends GuiContainer {
public class GuiSoulForge extends ContainerScreen {
public IInventory tileSoulForge;
public GuiSoulForge(InventoryPlayer playerInventory, IInventory tileSoulForge) {
public GuiSoulForge(PlayerInventory playerInventory, IInventory tileSoulForge) {
super(new ContainerSoulForge(playerInventory, tileSoulForge));
this.tileSoulForge = tileSoulForge;
this.xSize = 176;

View file

@ -3,17 +3,17 @@ package WayofTime.bloodmagic.client.gui;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.tile.container.ContainerTeleposer;
import WayofTime.bloodmagic.util.helper.TextHelper;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IInventory;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiTeleposer extends GuiContainer {
public GuiTeleposer(InventoryPlayer playerInventory, IInventory tileTeleposer) {
public class GuiTeleposer extends ContainerScreen {
public GuiTeleposer(PlayerInventory playerInventory, IInventory tileTeleposer) {
super(new ContainerTeleposer(playerInventory, tileTeleposer));
}

View file

@ -3,8 +3,8 @@ package WayofTime.bloodmagic.client.hud;
import WayofTime.bloodmagic.client.hud.element.HUDElement;
import com.google.common.collect.Maps;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
@ -17,16 +17,16 @@ import javax.vecmath.Vector2f;
import java.awt.Point;
import java.util.Map;
public class GuiEditHUD extends GuiScreen {
public class GuiEditHUD extends Screen {
private static final int LINE_COLOR = 0x2D2D2D;
private final GuiScreen parent;
private final Screen parent;
private final Map<ResourceLocation, Vector2f> currentOverrides = Maps.newHashMap();
private HUDElement dragged;
public boolean changes;
public GuiEditHUD(GuiScreen parent) {
public GuiEditHUD(Screen parent) {
this.parent = parent;
}
@ -102,7 +102,7 @@ public class GuiEditHUD extends GuiScreen {
}
@Override
protected void actionPerformed(GuiButton button) {
protected void actionPerformed(Button button) {
switch (button.id) {
case 0: {
Minecraft.getMinecraft().displayGuiScreen(parent);

View file

@ -8,7 +8,7 @@ import com.google.common.collect.Lists;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.ResourceLocation;
import java.util.List;
@ -32,7 +32,7 @@ public class ElementDemonAura extends HUDElement {
@Override
public void draw(ScaledResolution resolution, float partialTicks, int drawX, int drawY) {
Minecraft minecraft = Minecraft.getMinecraft();
EntityPlayer player = minecraft.player;
PlayerEntity player = minecraft.player;
minecraft.getTextureManager().bindTexture(BAR_LOCATION);
GlStateManager.color(1.0F, 1.0F, 1.0F);

View file

@ -3,10 +3,10 @@ package WayofTime.bloodmagic.client.hud.element;
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
import WayofTime.bloodmagic.item.sigil.ItemSigilHolding;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumHand;
import net.minecraft.util.Hand;
import java.util.List;
@ -21,8 +21,8 @@ public abstract class ElementDivinedInformation<T extends TileEntity> extends El
@Override
public boolean shouldRender(Minecraft minecraft) {
EntityPlayer player = Minecraft.getMinecraft().player;
ItemStack sigilStack = player.getHeldItem(EnumHand.MAIN_HAND);
PlayerEntity player = Minecraft.getMinecraft().player;
ItemStack sigilStack = player.getHeldItem(Hand.MAIN_HAND);
boolean flag = false;
if (simple) {
if (sigilStack.getItem() == RegistrarBloodMagicItems.SIGIL_DIVINATION || sigilStack.getItem() == RegistrarBloodMagicItems.SIGIL_SEER)
@ -30,7 +30,7 @@ public abstract class ElementDivinedInformation<T extends TileEntity> extends El
else flag = isFlagSigilHolding(sigilStack, true);
if (!flag) {
sigilStack = player.getHeldItem(EnumHand.OFF_HAND);
sigilStack = player.getHeldItem(Hand.OFF_HAND);
if (sigilStack.getItem() == RegistrarBloodMagicItems.SIGIL_DIVINATION || sigilStack.getItem() == RegistrarBloodMagicItems.SIGIL_SEER)
flag = true;
else flag = isFlagSigilHolding(sigilStack, true);
@ -42,7 +42,7 @@ public abstract class ElementDivinedInformation<T extends TileEntity> extends El
else flag = isFlagSigilHolding(sigilStack, false);
if (!flag) {
sigilStack = player.getHeldItem(EnumHand.OFF_HAND);
sigilStack = player.getHeldItem(Hand.OFF_HAND);
if (sigilStack.getItem() == RegistrarBloodMagicItems.SIGIL_SEER)
flag = true;
else flag = isFlagSigilHolding(sigilStack, false);

View file

@ -8,7 +8,7 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
@ -62,7 +62,7 @@ public class ElementHolding extends HUDElement {
return true;
}
protected void renderHotbarItem(int x, int y, float partialTicks, EntityPlayer player, ItemStack stack) {
protected void renderHotbarItem(int x, int y, float partialTicks, PlayerEntity player, ItemStack stack) {
if (!stack.isEmpty()) {
float animation = (float) stack.getAnimationsToGo() - partialTicks;

View file

@ -1,8 +1,8 @@
package WayofTime.bloodmagic.client.key;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
public interface IKeybindable {
void onKeyPressed(ItemStack stack, EntityPlayer player, KeyBindings key, boolean showInChat);
void onKeyPressed(ItemStack stack, PlayerEntity player, KeyBindings key, boolean showInChat);
}

View file

@ -6,7 +6,7 @@ import WayofTime.bloodmagic.network.BloodMagicPacketHandler;
import WayofTime.bloodmagic.network.KeyProcessor;
import WayofTime.bloodmagic.util.handler.event.ClientHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.settings.IKeyConflictContext;
@ -33,7 +33,7 @@ public enum KeyBindings {
@SideOnly(Side.CLIENT)
@Override
public void handleKeybind() {
EntityPlayerSP player = Minecraft.getMinecraft().player;
ClientPlayerEntity player = Minecraft.getMinecraft().player;
if (player.getHeldItemMainhand().getItem() instanceof ItemSigilHolding)
ClientHandler.cycleSigil(player.getHeldItemMainhand(), player, -1);
}
@ -42,7 +42,7 @@ public enum KeyBindings {
@SideOnly(Side.CLIENT)
@Override
public void handleKeybind() {
EntityPlayerSP player = Minecraft.getMinecraft().player;
ClientPlayerEntity player = Minecraft.getMinecraft().player;
if (player.getHeldItemMainhand().getItem() instanceof ItemSigilHolding)
ClientHandler.cycleSigil(player.getHeldItemMainhand(), player, 1);
}

View file

@ -3,7 +3,7 @@ package WayofTime.bloodmagic.client.mesh;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.iface.IActivatable;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.renderer.model.ModelResourceLocation;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;

View file

@ -4,7 +4,7 @@ import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.iface.IMultiWillTool;
import WayofTime.bloodmagic.soul.EnumDemonWillType;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.renderer.model.ModelResourceLocation;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;

View file

@ -5,7 +5,7 @@ import WayofTime.bloodmagic.soul.EnumDemonWillType;
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
import WayofTime.bloodmagic.item.soul.ItemSoulGem;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.renderer.model.ModelResourceLocation;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;

View file

@ -3,30 +3,30 @@ package WayofTime.bloodmagic.client.render;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.item.armour.ItemLivingArmour;
import WayofTime.bloodmagic.livingArmour.LivingArmour;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.entity.player.AbstractClientPlayerEntity;
import net.minecraft.client.model.ModelElytra;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.client.renderer.entity.layers.LayerArmorBase;
import net.minecraft.client.renderer.entity.PlayerRenderer;
import net.minecraft.client.renderer.entity.layers.ArmorLayer;
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
public class LayerBloodElytra implements LayerRenderer<AbstractClientPlayer> {
public class LayerBloodElytra implements LayerRenderer<AbstractClientPlayerEntity> {
private static final ResourceLocation TEXTURE_BLOOD_ELYTRA = new ResourceLocation("bloodmagic", "textures/entities/bloodElytra.png");
private final RenderPlayer renderPlayer;
private final PlayerRenderer renderPlayer;
private final ModelElytra modelElytra = new ModelElytra();
public LayerBloodElytra(RenderPlayer renderPlayer) {
public LayerBloodElytra(PlayerRenderer renderPlayer) {
this.renderPlayer = renderPlayer;
}
@Override
public void doRenderLayer(AbstractClientPlayer clientPlayer, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
public void doRenderLayer(AbstractClientPlayerEntity clientPlayer, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
if (LivingArmour.hasFullSet(clientPlayer)) {
ItemStack chestStack = clientPlayer.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
ItemStack chestStack = clientPlayer.getItemStackFromSlot(EquipmentSlotType.CHEST);
if (ItemLivingArmour.hasUpgrade(BloodMagic.MODID + ".upgrade.elytra", chestStack)) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.enableBlend();
@ -39,7 +39,7 @@ public class LayerBloodElytra implements LayerRenderer<AbstractClientPlayer> {
modelElytra.render(clientPlayer, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
if (chestStack.isItemEnchanted())
LayerArmorBase.renderEnchantedGlint(this.renderPlayer, clientPlayer, this.modelElytra, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale);
ArmorLayer.renderEnchantedGlint(this.renderPlayer, clientPlayer, this.modelElytra, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale);
GlStateManager.popMatrix();
}

View file

@ -8,7 +8,7 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
public class AttractorAlchemyCircleRenderer extends AlchemyCircleRenderer {
@ -78,8 +78,8 @@ public class AttractorAlchemyCircleRenderer extends AlchemyCircleRenderer {
GlStateManager.translate(x, y, z);
// Specify which face this "circle" is located on
EnumFacing sideHit = EnumFacing.UP;
EnumFacing rotation = tileArray.getRotation();
Direction sideHit = Direction.UP;
Direction rotation = tileArray.getRotation();
GlStateManager.translate(sideHit.getXOffset() * offsetFromFace, sideHit.getYOffset() * offsetFromFace, sideHit.getZOffset() * offsetFromFace);

View file

@ -7,7 +7,7 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
public class BindingAlchemyCircleRenderer extends AlchemyCircleRenderer {
@ -108,7 +108,7 @@ public class BindingAlchemyCircleRenderer extends AlchemyCircleRenderer {
GlStateManager.translate(x, y, z);
// Specify which face this "circle" is located on
EnumFacing sideHit = EnumFacing.UP;
Direction sideHit = Direction.UP;
GlStateManager.translate(sideHit.getXOffset() * offsetFromFace, sideHit.getYOffset() * offsetFromFace, sideHit.getZOffset() * offsetFromFace);
switch (sideHit) {

View file

@ -8,7 +8,7 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
public class DualAlchemyCircleRenderer extends AlchemyCircleRenderer {
@ -64,8 +64,8 @@ public class DualAlchemyCircleRenderer extends AlchemyCircleRenderer {
GlStateManager.translate(x, y, z);
// Specify which face this "circle" is located on
EnumFacing sideHit = EnumFacing.UP;
EnumFacing rotation = tileArray.getRotation();
Direction sideHit = Direction.UP;
Direction rotation = tileArray.getRotation();
GlStateManager.translate(sideHit.getXOffset() * offsetFromFace, sideHit.getYOffset() * offsetFromFace, sideHit.getZOffset() * offsetFromFace);

View file

@ -6,7 +6,7 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -78,8 +78,8 @@ public class MobSacrificeAlchemyCircleRenderer extends AlchemyCircleRenderer {
GlStateManager.translate(x, y, z);
// Specify which face this "circle" is located on
EnumFacing sideHit = EnumFacing.UP;
EnumFacing rotation = tileArray.getRotation();
Direction sideHit = Direction.UP;
Direction rotation = tileArray.getRotation();
GlStateManager.translate(sideHit.getXOffset() * offsetFromFace, sideHit.getYOffset() * offsetFromFace, sideHit.getZOffset() * offsetFromFace);

View file

@ -8,7 +8,7 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
public class SingleAlchemyCircleRenderer extends AlchemyCircleRenderer {
@ -62,8 +62,8 @@ public class SingleAlchemyCircleRenderer extends AlchemyCircleRenderer {
GlStateManager.translate(x, y, z);
// Specify which face this "circle" is located on
EnumFacing sideHit = EnumFacing.UP;
EnumFacing rotation = tileArray.getRotation();
Direction sideHit = Direction.UP;
Direction rotation = tileArray.getRotation();
GlStateManager.translate(sideHit.getXOffset() * offsetFromFace, sideHit.getYOffset() * offsetFromFace, sideHit.getZOffset() * offsetFromFace);

View file

@ -8,7 +8,7 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
public class StaticAlchemyCircleRenderer extends AlchemyCircleRenderer {
@ -67,8 +67,8 @@ public class StaticAlchemyCircleRenderer extends AlchemyCircleRenderer {
GlStateManager.translate(x, y, z);
// Specify which face this "circle" is located on
EnumFacing sideHit = EnumFacing.UP;
EnumFacing rotation = tileArray.getRotation();
Direction sideHit = Direction.UP;
Direction rotation = tileArray.getRotation();
GlStateManager.translate(sideHit.getXOffset() * offsetFromFace, sideHit.getYOffset() * offsetFromFace, sideHit.getZOffset() * offsetFromFace);

View file

@ -6,7 +6,7 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -88,8 +88,8 @@ public class TurretAlchemyCircleRenderer extends AlchemyCircleRenderer {
GlStateManager.translate(x, y, z);
// Specify which face this "circle" is located on
EnumFacing sideHit = EnumFacing.UP;
EnumFacing rotation = tileArray.getRotation();
Direction sideHit = Direction.UP;
Direction rotation = tileArray.getRotation();
GlStateManager.translate(sideHit.getXOffset() * offsetFromFace, sideHit.getYOffset() * offsetFromFace, sideHit.getZOffset() * offsetFromFace);

View file

@ -5,10 +5,10 @@ import WayofTime.bloodmagic.api.impl.recipe.RecipeAlchemyArray;
import WayofTime.bloodmagic.alchemyArray.AlchemyCircleRenderer;
import WayofTime.bloodmagic.core.registry.AlchemyArrayRecipeRegistry;
import WayofTime.bloodmagic.tile.TileAlchemyArray;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.item.ItemStack;
public class RenderAlchemyArray extends TileEntitySpecialRenderer<TileAlchemyArray> {
public class RenderAlchemyArray extends TileEntityRenderer<TileAlchemyArray> {
@Override
public void render(TileAlchemyArray alchemyArray, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
ItemStack inputStack = alchemyArray.getStackInSlot(0);

View file

@ -6,12 +6,12 @@ import WayofTime.bloodmagic.block.BlockLifeEssence;
import WayofTime.bloodmagic.tile.TileAltar;
import WayofTime.bloodmagic.util.handler.event.ClientHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.client.renderer.*;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
@ -20,7 +20,7 @@ import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import org.lwjgl.opengl.GL11;
public class RenderAltar extends TileEntitySpecialRenderer<TileAltar> {
public class RenderAltar extends TileEntityRenderer<TileAltar> {
private static final float MIN_HEIGHT = 0.499f;
private static final float MAX_HEIGHT = 0.745f;
@ -58,7 +58,7 @@ public class RenderAltar extends TileEntitySpecialRenderer<TileAltar> {
int fluidColor = fluid.getColor(fluidStack);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
Minecraft.getMinecraft().renderEngine.bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE);
setGLColorFromInt(fluidColor);
double uMin = (double) fluidStillSprite.getMinU();
@ -78,7 +78,7 @@ public class RenderAltar extends TileEntitySpecialRenderer<TileAltar> {
}
private void renderItem(ItemStack stack) {
RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem();
ItemRenderer itemRenderer = Minecraft.getMinecraft().getRenderItem();
if (!stack.isEmpty()) {
GlStateManager.translate(0.5, 1, 0.5);
GlStateManager.pushMatrix();
@ -100,7 +100,7 @@ public class RenderAltar extends TileEntitySpecialRenderer<TileAltar> {
}
private void renderHologram(TileAltar altar, AltarTier tier, float partialTicks) {
EntityPlayerSP player = Minecraft.getMinecraft().player;
ClientPlayerEntity player = Minecraft.getMinecraft().player;
World world = player.world;
if (tier == AltarTier.ONE)

View file

@ -6,9 +6,9 @@ import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fml.relauncher.Side;
@ -16,7 +16,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class RenderBloodTank extends TileEntitySpecialRenderer<TileBloodTank> {
public class RenderBloodTank extends TileEntityRenderer<TileBloodTank> {
private static final Minecraft mc = Minecraft.getMinecraft();
@Override
@ -30,7 +30,7 @@ public class RenderBloodTank extends TileEntitySpecialRenderer<TileBloodTank> {
GlStateManager.pushMatrix();
bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE);
renderFluid(bloodTank.getRenderHeight(), renderFluid, x, y, z);

View file

@ -4,15 +4,15 @@ import WayofTime.bloodmagic.tile.TileDemonCrucible;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.RenderItem;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
public class RenderDemonCrucible extends TileEntitySpecialRenderer<TileDemonCrucible> {
public class RenderDemonCrucible extends TileEntityRenderer<TileDemonCrucible> {
public static Minecraft mc = Minecraft.getMinecraft();
public static ResourceLocation resource = new ResourceLocation("bloodmagic", "textures/blocks/lifeEssenceStill.png");
public static float minHeight = 0.6497f;
@ -29,10 +29,10 @@ public class RenderDemonCrucible extends TileEntitySpecialRenderer<TileDemonCruc
}
private void renderItem(World world, ItemStack stack, float partialTicks) {
RenderItem itemRenderer = mc.getRenderItem();
ItemRenderer itemRenderer = mc.getRenderItem();
if (!stack.isEmpty()) {
GlStateManager.translate(0.5, 1.5, 0.5);
EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, stack);
ItemEntity entityitem = new ItemEntity(world, 0.0D, 0.0D, 0.0D, stack);
entityitem.getItem().setCount(1);
entityitem.hoverStart = 0.0F;
GlStateManager.pushMatrix();

View file

@ -4,7 +4,7 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import org.lwjgl.opengl.GL11;
@ -18,7 +18,7 @@ public class RenderFakeBlocks {
double maxZ = minZ + 1;
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder wr = tessellator.getBuffer();
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
Minecraft.getMinecraft().renderEngine.bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE);
wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);

View file

@ -9,7 +9,7 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
@ -18,7 +18,7 @@ import org.lwjgl.opengl.GL11;
import java.util.List;
public class RenderItemRoutingNode extends TileEntitySpecialRenderer<TileRoutingNode> {
public class RenderItemRoutingNode extends TileEntityRenderer<TileRoutingNode> {
private static final ResourceLocation beamTexture = new ResourceLocation(BloodMagic.MODID, "textures/entities/nodeBeam.png");
private static final Minecraft mc = Minecraft.getMinecraft();

View file

@ -2,13 +2,13 @@ package WayofTime.bloodmagic.client.render.block;
import WayofTime.bloodmagic.tile.TileMimic;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderMimic extends TileEntitySpecialRenderer<TileMimic> {
public class RenderMimic extends TileEntityRenderer<TileMimic> {
public void render(TileMimic mimic, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
if (mimic.getStackInSlot(0) != null) {
TileEntity testTile = mimic.mimicedTile;

View file

@ -1,13 +1,13 @@
package WayofTime.bloodmagic.client.render.entity;
import WayofTime.bloodmagic.entity.projectile.EntityBloodLight;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraftforge.fml.client.registry.IRenderFactory;
public class BloodLightRenderFactory implements IRenderFactory<EntityBloodLight> {
@Override
public Render<? super EntityBloodLight> createRenderFor(RenderManager manager) {
public EntityRenderer<? super EntityBloodLight> createRenderFor(EntityRendererManager manager) {
return new RenderEntityBloodLight(manager);
}
}

View file

@ -1,13 +1,13 @@
package WayofTime.bloodmagic.client.render.entity;
import WayofTime.bloodmagic.entity.mob.EntityCorruptedChicken;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraftforge.fml.client.registry.IRenderFactory;
public class CorruptedChickenRenderFactory implements IRenderFactory<EntityCorruptedChicken> {
@Override
public Render<? super EntityCorruptedChicken> createRenderFor(RenderManager manager) {
public EntityRenderer<? super EntityCorruptedChicken> createRenderFor(EntityRendererManager manager) {
return new RenderCorruptedChicken(manager);
}
}

View file

@ -1,13 +1,13 @@
package WayofTime.bloodmagic.client.render.entity;
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSheep;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraftforge.fml.client.registry.IRenderFactory;
public class CorruptedSheepRenderFactory implements IRenderFactory<EntityCorruptedSheep> {
@Override
public Render<? super EntityCorruptedSheep> createRenderFor(RenderManager manager) {
public EntityRenderer<? super EntityCorruptedSheep> createRenderFor(EntityRendererManager manager) {
return new RenderCorruptedSheep(manager);
}
}

Some files were not shown because too many files have changed in this diff Show more