2 Commits
1.14 ... 1.13

16 changed files with 19 additions and 31 deletions

View File

@@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
version = '1.13.2-2.15'
version = '1.13.2-2.16'
group = 'nl.requios.effortlessbuilding' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'effortlessbuilding'

View File

@@ -46,7 +46,7 @@ public class EffortlessBuilding
{
public static final String MODID = "effortlessbuilding";
public static final String NAME = "Effortless Building";
public static final String VERSION = "1.13.2-2.15";
public static final String VERSION = "1.13.2-2.16";
public static EffortlessBuilding instance;

View File

@@ -41,7 +41,7 @@ public class Circle extends TwoClicksBuildMode {
if (ModeOptions.getFill() == ModeOptions.ActionEnum.FULL)
addCircleBlocks(list, x1, y1, z1, x2, y2, z2, centerX, centerZ, radiusX, radiusZ);
else
addHollowCircleBlocks(list, x1, y1, z1, x2, y2, z2, centerX, centerZ, radiusX, radiusZ, 1f);
addHollowCircleBlocks(list, x1, y1, z1, x2, y2, z2, centerX, centerZ, radiusX, radiusZ);
return list;
}
@@ -60,7 +60,7 @@ public class Circle extends TwoClicksBuildMode {
}
}
public static void addHollowCircleBlocks(List<BlockPos> list, int x1, int y1, int z1, int x2, int y2, int z2, float centerX, float centerZ, float radiusX, float radiusZ, float thickness) {
public static void addHollowCircleBlocks(List<BlockPos> list, int x1, int y1, int z1, int x2, int y2, int z2, float centerX, float centerZ, float radiusX, float radiusZ) {
for (int l = x1; x1 < x2 ? l <= x2 : l >= x2; l += x1 < x2 ? 1 : -1) {
@@ -68,7 +68,7 @@ public class Circle extends TwoClicksBuildMode {
float distance = distance(l, n, centerX, centerZ);
float radius = calculateEllipseRadius(centerX, centerZ, radiusX, radiusZ, l, n);
if (distance < radius + (thickness / 2f) && distance > radius - (thickness / 2f))
if (distance < radius + 0.4f && distance > radius - 0.6f)
list.add(new BlockPos(l, y1, n));
}
}

View File

@@ -56,7 +56,7 @@ public class Sphere extends ThreeClicksBuildMode {
if (ModeOptions.getFill() == ModeOptions.ActionEnum.FULL)
addSphereBlocks(list, x1, y1, z1, x3, y3, z3, centerX, centerY, centerZ, radiusX, radiusY, radiusZ);
else
addHollowSphereBlocks(list, x1, y1, z1, x3, y3, z3, centerX, centerY, centerZ, radiusX, radiusY, radiusZ, 1f);
addHollowSphereBlocks(list, x1, y1, z1, x3, y3, z3, centerX, centerY, centerZ, radiusX, radiusY, radiusZ);
return list;
}
@@ -71,7 +71,7 @@ public class Sphere extends ThreeClicksBuildMode {
float distance = distance(l, m, n, centerX, centerY, centerZ);
float radius = calculateSpheroidRadius(centerX, centerY, centerZ, radiusX, radiusY, radiusZ, l, m, n);
if (distance < radius + 0.5f)
if (distance < radius + 0.4f)
list.add(new BlockPos(l, m, n));
}
}
@@ -79,7 +79,7 @@ public class Sphere extends ThreeClicksBuildMode {
}
public static void addHollowSphereBlocks(List<BlockPos> list, int x1, int y1, int z1, int x2, int y2, int z2,
float centerX, float centerY, float centerZ, float radiusX, float radiusY, float radiusZ, float thickness) {
float centerX, float centerY, float centerZ, float radiusX, float radiusY, float radiusZ) {
for (int l = x1; x1 < x2 ? l <= x2 : l >= x2; l += x1 < x2 ? 1 : -1) {
for (int n = z1; z1 < z2 ? n <= z2 : n >= z2; n += z1 < z2 ? 1 : -1) {
@@ -88,7 +88,7 @@ public class Sphere extends ThreeClicksBuildMode {
float distance = distance(l, m, n, centerX, centerY, centerZ);
float radius = calculateSpheroidRadius(centerX, centerY, centerZ, radiusX, radiusY, radiusZ, l, m, n);
if (distance < radius + (thickness / 2f) && distance > radius - (thickness / 2f))
if (distance < radius + 0.4f && distance > radius - 0.6f)
list.add(new BlockPos(l, m, n));
}
}

View File

@@ -205,6 +205,7 @@ public class UndoRedo {
private static ItemStack findItemStackInInventory(EntityPlayer player, IBlockState blockState) {
ItemStack itemStack = ItemStack.EMPTY;
if (blockState == null) return itemStack;
//First try previousBlockStates
//TODO try to find itemstack with right blockstate first

View File

@@ -67,8 +67,6 @@ public class AddUndoMessage {
public static void handle(AddUndoMessage message, Supplier<NetworkEvent.Context> ctx)
{
ctx.get().enqueueWork(() -> {
EffortlessBuilding.log("AddUndoMessage");
if (ctx.get().getDirection().getReceptionSide() == LogicalSide.CLIENT) {
//Received clientside

View File

@@ -82,7 +82,6 @@ public class BlockBrokenMessage {
{
public static void handle(BlockBrokenMessage message, Supplier<NetworkEvent.Context> ctx)
{
EffortlessBuilding.log("BlockBrokenMessage");
ctx.get().enqueueWork(() -> {
if (ctx.get().getDirection().getReceptionSide() == LogicalSide.SERVER) {
//Received serverside

View File

@@ -95,8 +95,6 @@ public class BlockPlacedMessage {
public static void handle(BlockPlacedMessage message, Supplier<NetworkEvent.Context> ctx)
{
ctx.get().enqueueWork(() -> {
EffortlessBuilding.log("BlockPlacedMessage");
if (ctx.get().getDirection().getReceptionSide() == LogicalSide.CLIENT) {
//Received clientside
//Nod RenderHandler to do the dissolve shader effect

View File

@@ -25,8 +25,6 @@ public class CancelModeMessage {
public static void handle(CancelModeMessage message, Supplier<NetworkEvent.Context> ctx)
{
ctx.get().enqueueWork(() -> {
EffortlessBuilding.log("CancelModeMessage");
EntityPlayer player = EffortlessBuilding.proxy.getPlayerEntityFromContext(ctx);
BuildModes.initializeMode(player);

View File

@@ -30,8 +30,6 @@ public class ClearUndoMessage {
public static void handle(ClearUndoMessage message, Supplier<NetworkEvent.Context> ctx)
{
ctx.get().enqueueWork(() -> {
EffortlessBuilding.log("ClearUndoMessage");
if (ctx.get().getDirection().getReceptionSide() == LogicalSide.CLIENT) {
//Received clientside
EntityPlayer player = EffortlessBuilding.proxy.getPlayerEntityFromContext(ctx);

View File

@@ -36,8 +36,6 @@ public class ModeActionMessage {
public static void handle(ModeActionMessage message, Supplier<NetworkEvent.Context> ctx)
{
ctx.get().enqueueWork(() -> {
EffortlessBuilding.log("ModeActionMessage");
EntityPlayer player = EffortlessBuilding.proxy.getPlayerEntityFromContext(ctx);
ModeOptions.performAction(player, message.action);

View File

@@ -41,8 +41,6 @@ public class ModeSettingsMessage {
public static void handle(ModeSettingsMessage message, Supplier<NetworkEvent.Context> ctx)
{
ctx.get().enqueueWork(() -> {
EffortlessBuilding.log("ModeSettingsMessage");
EntityPlayer player = EffortlessBuilding.proxy.getPlayerEntityFromContext(ctx);
// Sanitize

View File

@@ -129,8 +129,6 @@ public class ModifierSettingsMessage {
public static void handle(ModifierSettingsMessage message, Supplier<NetworkEvent.Context> ctx)
{
ctx.get().enqueueWork(() -> {
EffortlessBuilding.log("ModifierSettingsMessage");
EntityPlayer player = EffortlessBuilding.proxy.getPlayerEntityFromContext(ctx);
// Sanitize

View File

@@ -49,8 +49,6 @@ public class RequestLookAtMessage {
public static void handle(RequestLookAtMessage message, Supplier<NetworkEvent.Context> ctx)
{
ctx.get().enqueueWork(() -> {
EffortlessBuilding.log("RequestLookAtMessage");
if (ctx.get().getDirection().getReceptionSide() == LogicalSide.CLIENT) {
//Received clientside
//Send back your info

View File

@@ -198,15 +198,17 @@ public class BlockPreviewRenderer {
//if so, renew randomness of randomizer bag
ItemRandomizerBag.renewRandomness();
//and play sound (max once every tick)
if (startCoordinates.size() > 1 && blockStates.size() > 1 && soundTime < ClientProxy.ticksInGame - 0) {
if (newCoordinates.size() > 1 && blockStates.size() > 1 && soundTime < ClientProxy.ticksInGame - 0) {
soundTime = ClientProxy.ticksInGame;
if (blockStates.get(0) != null) {
SoundType soundType = blockStates.get(0).getBlock().getSoundType(blockStates.get(0), player.world,
newCoordinates.get(0), player);
player.world.playSound(player, player.getPosition(), breaking ? soundType.getBreakSound() : soundType.getPlaceSound(),
SoundCategory.BLOCKS, 0.3f, 0.8f);
}
}
}
//Render block previews
if (blockStates.size() != 0 && newCoordinates.size() == blockStates.size()) {

View File

@@ -203,6 +203,8 @@ public class RenderHandler implements IWorldEventListener {
}
protected static void renderBlockPreview(BlockRendererDispatcher dispatcher, BlockPos blockPos, IBlockState blockState) {
if (blockState == null) return;
GlStateManager.pushMatrix();
GlStateManager.translatef(blockPos.getX(), blockPos.getY(), blockPos.getZ());
GlStateManager.rotatef(-90.0F, 0.0F, 1.0F, 0.0F);