mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-25 06:27:41 +01:00
Server-side and Migration crashes
- Fixed crash on server start-up - Fixed internal server error when equipping a blockzapper - "Fixed" belts not behaving when migrated from 0.1 (destroying them) - Fixed Saws not having a kill message - Fixed Drill not damaging entities - Added recipe for the storage interface
This commit is contained in:
parent
71c65615bc
commit
15680a6c0b
7 changed files with 68 additions and 10 deletions
|
@ -4,6 +4,8 @@ import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.AbstractGui;
|
import net.minecraft.client.gui.AbstractGui;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
public enum ScreenResources {
|
public enum ScreenResources {
|
||||||
|
|
||||||
|
@ -169,8 +171,6 @@ public enum ScreenResources {
|
||||||
public final ResourceLocation location;
|
public final ResourceLocation location;
|
||||||
public int width, height;
|
public int width, height;
|
||||||
public int startX, startY;
|
public int startX, startY;
|
||||||
static Screen renderer = new Screen(null) {
|
|
||||||
};
|
|
||||||
|
|
||||||
private ScreenResources(String location, int width, int height) {
|
private ScreenResources(String location, int width, int height) {
|
||||||
this(location, 0, 0, width, height);
|
this(location, 0, 0, width, height);
|
||||||
|
@ -188,17 +188,21 @@ public enum ScreenResources {
|
||||||
this.startY = startY;
|
this.startY = startY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OnlyIn(Dist.CLIENT)
|
||||||
public void bind() {
|
public void bind() {
|
||||||
Minecraft.getInstance().getTextureManager().bindTexture(location);
|
Minecraft.getInstance().getTextureManager().bindTexture(location);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OnlyIn(Dist.CLIENT)
|
||||||
public void draw(AbstractGui screen, int x, int y) {
|
public void draw(AbstractGui screen, int x, int y) {
|
||||||
bind();
|
bind();
|
||||||
screen.blit(x, y, startX, startY, width, height);
|
screen.blit(x, y, startX, startY, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OnlyIn(Dist.CLIENT)
|
||||||
public void draw(int x, int y) {
|
public void draw(int x, int y) {
|
||||||
draw(renderer, x, y);
|
draw(new Screen(null) {
|
||||||
|
}, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,10 +10,15 @@ import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.Blocks;
|
import net.minecraft.block.Blocks;
|
||||||
import net.minecraft.block.material.PushReaction;
|
import net.minecraft.block.material.PushReaction;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.item.ItemEntity;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.util.Direction;
|
import net.minecraft.util.Direction;
|
||||||
import net.minecraft.util.Direction.Axis;
|
import net.minecraft.util.Direction.Axis;
|
||||||
|
import net.minecraft.util.math.AxisAlignedBB;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.MathHelper;
|
||||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||||
import net.minecraft.util.math.shapes.VoxelShape;
|
import net.minecraft.util.math.shapes.VoxelShape;
|
||||||
import net.minecraft.world.IBlockReader;
|
import net.minecraft.world.IBlockReader;
|
||||||
|
@ -23,6 +28,7 @@ import net.minecraft.world.World;
|
||||||
public class DrillBlock extends DirectionalKineticBlock implements IPortableBlock, IWithTileEntity<DrillTileEntity> {
|
public class DrillBlock extends DirectionalKineticBlock implements IPortableBlock, IWithTileEntity<DrillTileEntity> {
|
||||||
|
|
||||||
public static MovementBehaviour MOVEMENT = new DrillMovementBehaviour();
|
public static MovementBehaviour MOVEMENT = new DrillMovementBehaviour();
|
||||||
|
public static DamageSource damageSourceDrill = new DamageSource("create.drill").setDamageBypassesArmor();
|
||||||
|
|
||||||
public DrillBlock() {
|
public DrillBlock() {
|
||||||
super(Properties.from(Blocks.IRON_BLOCK));
|
super(Properties.from(Blocks.IRON_BLOCK));
|
||||||
|
@ -33,6 +39,19 @@ public class DrillBlock extends DirectionalKineticBlock implements IPortableBloc
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEntityCollision(BlockState state, World worldIn, BlockPos pos, Entity entityIn) {
|
||||||
|
if (entityIn instanceof ItemEntity)
|
||||||
|
return;
|
||||||
|
if (!new AxisAlignedBB(pos).shrink(.1f).intersects(entityIn.getBoundingBox()))
|
||||||
|
return;
|
||||||
|
withTileEntityDo(worldIn, pos, te -> {
|
||||||
|
if (te.getSpeed() == 0)
|
||||||
|
return;
|
||||||
|
entityIn.attackEntityFrom(damageSourceDrill, MathHelper.clamp(Math.abs(te.getSpeed() / 32f) + 1, 0, 20));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||||
return new DrillTileEntity();
|
return new DrillTileEntity();
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class SawBlock extends DirectionalAxisKineticBlock implements IWithTileEn
|
||||||
withTileEntityDo(worldIn, pos, te -> {
|
withTileEntityDo(worldIn, pos, te -> {
|
||||||
if (te.getSpeed() == 0)
|
if (te.getSpeed() == 0)
|
||||||
return;
|
return;
|
||||||
entityIn.attackEntityFrom(damageSourceSaw, MathHelper.clamp(Math.abs(te.getSpeed() / 512f) + 1, 0, 20));
|
entityIn.attackEntityFrom(damageSourceSaw, MathHelper.clamp(Math.abs(te.getSpeed() / 32f) + 1, 0, 20));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,15 @@ public class BeltTileEntity extends KineticTileEntity {
|
||||||
index = -1;
|
index = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initialize() {
|
||||||
|
super.initialize();
|
||||||
|
// 0.1 belt
|
||||||
|
if (beltLength == 0) {
|
||||||
|
world.destroyBlock(pos, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
super.tick();
|
super.tick();
|
||||||
|
|
|
@ -30,6 +30,7 @@ public class TerrainzapperItem extends ZapperItem implements IHaveCustomItemMode
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@OnlyIn(value = Dist.CLIENT)
|
||||||
protected void openHandgunGUI(ItemStack item, boolean b) {
|
protected void openHandgunGUI(ItemStack item, boolean b) {
|
||||||
ScreenOpener.open(new TerrainzapperScreen(item, b));
|
ScreenOpener.open(new TerrainzapperScreen(item, b));
|
||||||
}
|
}
|
||||||
|
|
|
@ -273,6 +273,7 @@
|
||||||
"death.attack.create.fan_fire": "%1$s was burned to death by hot air",
|
"death.attack.create.fan_fire": "%1$s was burned to death by hot air",
|
||||||
"death.attack.create.fan_lava": "%1$s was burned to death by lava fan",
|
"death.attack.create.fan_lava": "%1$s was burned to death by lava fan",
|
||||||
"death.attack.create.drill": "%1$s was impaled by Mechanical Drill",
|
"death.attack.create.drill": "%1$s was impaled by Mechanical Drill",
|
||||||
|
"death.attack.create.saw": "%1$s got cut in half by Mechanical Saw",
|
||||||
"create.block.deployer.damage_source_name": "a rogue Deployer",
|
"create.block.deployer.damage_source_name": "a rogue Deployer",
|
||||||
"death.attack.create.curse_polish": "%1$s tried to polish a cursed item",
|
"death.attack.create.curse_polish": "%1$s tried to polish a cursed item",
|
||||||
"death.attack.create.cuckoo_clock_explosion": "%1$s was blown up by tampered cuckoo clock",
|
"death.attack.create.cuckoo_clock_explosion": "%1$s was blown up by tampered cuckoo clock",
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
"type": "crafting_shaped",
|
||||||
|
"pattern": [
|
||||||
|
"LT"
|
||||||
|
],
|
||||||
|
"key": {
|
||||||
|
"L": {
|
||||||
|
"item": "create:andesite_casing"
|
||||||
|
},
|
||||||
|
"T": {
|
||||||
|
"item": "create:extractor"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"item": "create:portable_storage_interface",
|
||||||
|
"count": 1
|
||||||
|
},
|
||||||
|
"conditions": [
|
||||||
|
{
|
||||||
|
"type": "create:module",
|
||||||
|
"module": "contraptions"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in a new issue