@SuppressWarnings("unchecked")
public class mcreator_ggg {
public Object instance;
public static int DIMID = 3;
public static BlockTutorialPortal portal;
public static ModTrigger block;
static{
portal = (BlockTutorialPortal)(new BlockTutorialPortal()
.setBlockName("ggg_portal")
.setBlockTextureName("1234"));
Block.blockRegistry.addObject(176, "ggg_portal", portal);
block = (ModTrigger)(new ModTrigger().setUnlocalizedName("ggg_trigger").setTextureName("213"));
Item.itemRegistry.addObject(424, "ggg_trigger", block);
}
public mcreator_ggg(){}
public void load(){
GameRegistry.registerBlock(portal, "ggg_portal");
DimensionManager.registerProviderType(DIMID, mcreator_ggg.WorldProviderMod.class, false);
DimensionManager.registerDimension(DIMID, DIMID);
}
public void registerRenderers(){}
public void generateNether(World world, Random random, int chunkX, int chunkZ){}
public void generateSurface(World world, Random random, int chunkX, int chunkZ){}
public int addFuel(ItemStack fuel){
return 0;
}
public void serverLoad(FMLServerStartingEvent event){}
public void preInit(FMLPreInitializationEvent event){}
public static class WorldProviderMod extends WorldProvider{
public void registerWorldChunkManager(){
this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.ocean, 0.0F);
this.isHellWorld = true;
this.hasNoSky = true;
this.dimensionId = DIMID;
}
@SideOnly(Side.CLIENT)
public Vec3 getFogColor(float par1, float par2){
return Vec3.createVectorHelper(1.0D,1.0D,1.0D);
}
public IChunkProvider createChunkGenerator(){
return new ChunkProviderModded(this.worldObj, this.worldObj.getSeed()-22619);
}
public boolean isSurfaceWorld(){
return false;
}
public boolean canCoordinateBeSpawn(int par1, int par2){
return false;
}
public boolean canRespawnHere(){
return false;
}
@SideOnly(Side.CLIENT)
public boolean doesXZShowFog(int par1, int par2){
return false;
}
public String getDimensionName(){
return "ggg";
}
@Override protected void generateLightBrightnessTable() {float f = 0.5F;for(int i = 0; i <= 15; ++i) {float f1 = 1.0F - (float) i / 15.0F;this.lightBrightnessTable[i] = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f;}}
}
public class TutorialPortalPosition extends ChunkCoordinates{
public long field_85087_d;
final TeleporterDimensionMod field_85088_e;
public TutorialPortalPosition(TeleporterDimensionMod tutorialTeleporter, int par2, int par3, int par4, long par5){
super(par2, par3, par4);
this.field_85088_e = tuTeleporter;
this.field_85087_d = par5;
}
}
public static class TeleporterDimensionMod extends Teleporter {
private final WorldServer worldServerInstance;
private final List destinationCoordinateKeys = new ArrayList();
private static final String __OBFID = "CL_00000153";
public TeleporterDimensionMod(WorldServer par1WorldServer){
super(par1WorldServer);
this.worldServerInstance = par1WorldServer;
this.random = new Random(par1WorldServer.getSeed());
}
public void placeInPortal(Entity par1Entity, double par2, double par4, double par6, float par8)
{
if (this.worldServerInstance.provider.dimensionId != 1)
{
if (!this.placeInExistingPortal(par1Entity, par2, par4, par6, par8))
{
this.makePortal(par1Entity);
this.placeInExistingPortal(par1Entity, par2, par4, par6, par8);
}
}
else
{
int i = MathHelper.floor_double(par1Entity.posX);
int j = MathHelper.floor_double(par1Entity.posY) - 1;
int k = MathHelper.floor_double(par1Entity.posZ);
byte b0 = 1;
byte b1 = 0;
for (int l = -2; l <= 2; ++l)
{
for (int i1 = -2; i1 <= 2; ++i1)
{
for (int j1 = -1; j1 < 3; ++j1)
{
int k1 = i + i1 * b0 + l * b1;
int l1 = j + j1;
int i2 = k + i1 * b1 - l * b0;
boolean flag = j1 < 0;
this.worldServerInstance.setBlock(k1, l1, i2, flag ? Blocks.lapis_ore : Blocks.air);
}
}
}
par1Entity.setLocationAndAngles((double)i, (double)j, (double)k, par1Entity.rotationYaw, 0.0F);
par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D;
}
}
if (d3 >= 0.0D)
{
if (flag)
{
this.destinationCoordinateCache.add(j1, new Teleporter.PortalPosition(i, j, k, this.worldServerInstance.getTotalWorldTime()));
this.destinationCoordinateKeys.add(Long.valueOf(j1));
}
double d11 = (double)i + 0.5D;
double d6 = (double)j + 0.5D;
d7 = (double)k + 0.5D;
int i4 = -1;
if (this.worldServerInstance.getBlock(i - 1, j, k) == portal)
{
i4 = 2;
}
if (this.worldServerInstance.getBlock(i + 1, j, k) == portal)
{
i4 = 0;
}
if (this.worldServerInstance.getBlock(i, j, k - 1) == portal)
{
i4 = 3;
}
if (this.worldServerInstance.getBlock(i, j, k + 1) == portal)
{
i4 = 1;
}
int j2 = par1Entity.getTeleportDirection();
if (i4 > -1)
{
int k2 = Direction.rotateLeft[i4];
int l2 = Direction.offsetX[i4];
int i3 = Direction.offsetZ[i4];
int j3 = Direction.offsetX[k2];
int k3 = Direction.offsetZ[k2];
boolean flag1 = !this.worldServerInstance.isAirBlock(i + l2 + j3, j, k + i3 + k3) || !this.worldServerInstance.isAirBlock(i + l2 + j3, j + 1, k + i3 + k3);
boolean flag2 = !this.worldServerInstance.isAirBlock(i + l2, j, k + i3) || !this.worldServerInstance.isAirBlock(i + l2, j + 1, k + i3);
if (flag1 && flag2)
{
i4 = Direction.rotateOpposite[i4];
k2 = Direction.rotateOpposite[k2];
l2 = Direction.offsetX[i4];
i3 = Direction.offsetZ[i4];
j3 = Direction.offsetX[k2];
k3 = Direction.offsetZ[k2];
l3 = i - j3;
d11 -= (double)j3;
int k1 = k - k3;
d7 -= (double)k3;
flag1 = !this.worldServerInstance.isAirBlock(l3 + l2 + j3, j, k1 + i3 + k3) || !this.worldServerInstance.isAirBlock(l3 + l2 + j3, j + 1, k1 + i3 + k3);
flag2 = !this.worldServerInstance.isAirBlock(l3 + l2, j, k1 + i3) || !this.worldServerInstance.isAirBlock(l3 + l2, j + 1, k1 + i3);
}
float f1 = 0.5F;
float f2 = 0.5F;
if (!flag1 && flag2)
{
f1 = 1.0F;
}
else if (flag1 && !flag2)
{
f1 = 0.0F;
}
else if (flag1 && flag2)
{
f2 = 0.0F;
}
d11 += (double)((float)j3 * f1 + f2 * (float)l2);
d7 += (double)((float)k3 * f1 + f2 * (float)i3);
float f3 = 0.0F;
float f4 = 0.0F;
float f5 = 0.0F;
float f6 = 0.0F;
if (i4 == j2)
{
f3 = 1.0F;
f4 = 1.0F;
}
else if (i4 == Direction.rotateOpposite[j2])
{
f3 = -1.0F;
f4 = -1.0F;
}
else if (i4 == Direction.rotateRight[j2])
{
f5 = 1.0F;
f6 = -1.0F;
}
else
{
f5 = -1.0F;
f6 = 1.0F;
}
double d9 = par1Entity.motionX;
double d10 = par1Entity.motionZ;
par1Entity.motionX = d9 * (double)f3 + d10 * (double)f6;
par1Entity.motionZ = d9 * (double)f5 + d10 * (double)f4;
par1Entity.rotationYaw = par8 - (float)(j2 * 90) + (float)(i4 * 90);
}
else
{
par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D;
}
par1Entity.setLocationAndAngles(d11, d6, d7, par1Entity.rotationYaw, par1Entity.rotationPitch);
return true;
}
else
{
return false;
}
}
}