Compare commits
2 Commits
1.19-hotfi
...
1.13
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad4db4a5f6 | ||
|
|
278fbc5dfe |
@@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle'
|
|||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
apply plugin: 'maven-publish'
|
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
|
group = 'nl.requios.effortlessbuilding' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
archivesBaseName = 'effortlessbuilding'
|
archivesBaseName = 'effortlessbuilding'
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class EffortlessBuilding
|
|||||||
{
|
{
|
||||||
public static final String MODID = "effortlessbuilding";
|
public static final String MODID = "effortlessbuilding";
|
||||||
public static final String NAME = "Effortless Building";
|
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;
|
public static EffortlessBuilding instance;
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class Circle extends TwoClicksBuildMode {
|
|||||||
if (ModeOptions.getFill() == ModeOptions.ActionEnum.FULL)
|
if (ModeOptions.getFill() == ModeOptions.ActionEnum.FULL)
|
||||||
addCircleBlocks(list, x1, y1, z1, x2, y2, z2, centerX, centerZ, radiusX, radiusZ);
|
addCircleBlocks(list, x1, y1, z1, x2, y2, z2, centerX, centerZ, radiusX, radiusZ);
|
||||||
else
|
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;
|
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) {
|
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 distance = distance(l, n, centerX, centerZ);
|
||||||
float radius = calculateEllipseRadius(centerX, centerZ, radiusX, radiusZ, l, n);
|
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));
|
list.add(new BlockPos(l, y1, n));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class Sphere extends ThreeClicksBuildMode {
|
|||||||
if (ModeOptions.getFill() == ModeOptions.ActionEnum.FULL)
|
if (ModeOptions.getFill() == ModeOptions.ActionEnum.FULL)
|
||||||
addSphereBlocks(list, x1, y1, z1, x3, y3, z3, centerX, centerY, centerZ, radiusX, radiusY, radiusZ);
|
addSphereBlocks(list, x1, y1, z1, x3, y3, z3, centerX, centerY, centerZ, radiusX, radiusY, radiusZ);
|
||||||
else
|
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;
|
return list;
|
||||||
}
|
}
|
||||||
@@ -71,7 +71,7 @@ public class Sphere extends ThreeClicksBuildMode {
|
|||||||
|
|
||||||
float distance = distance(l, m, n, centerX, centerY, centerZ);
|
float distance = distance(l, m, n, centerX, centerY, centerZ);
|
||||||
float radius = calculateSpheroidRadius(centerX, centerY, centerZ, radiusX, radiusY, radiusZ, l, m, n);
|
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));
|
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,
|
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 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) {
|
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 distance = distance(l, m, n, centerX, centerY, centerZ);
|
||||||
float radius = calculateSpheroidRadius(centerX, centerY, centerZ, radiusX, radiusY, radiusZ, l, m, n);
|
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));
|
list.add(new BlockPos(l, m, n));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -205,6 +205,7 @@ public class UndoRedo {
|
|||||||
|
|
||||||
private static ItemStack findItemStackInInventory(EntityPlayer player, IBlockState blockState) {
|
private static ItemStack findItemStackInInventory(EntityPlayer player, IBlockState blockState) {
|
||||||
ItemStack itemStack = ItemStack.EMPTY;
|
ItemStack itemStack = ItemStack.EMPTY;
|
||||||
|
if (blockState == null) return itemStack;
|
||||||
|
|
||||||
//First try previousBlockStates
|
//First try previousBlockStates
|
||||||
//TODO try to find itemstack with right blockstate first
|
//TODO try to find itemstack with right blockstate first
|
||||||
|
|||||||
@@ -67,8 +67,6 @@ public class AddUndoMessage {
|
|||||||
public static void handle(AddUndoMessage message, Supplier<NetworkEvent.Context> ctx)
|
public static void handle(AddUndoMessage message, Supplier<NetworkEvent.Context> ctx)
|
||||||
{
|
{
|
||||||
ctx.get().enqueueWork(() -> {
|
ctx.get().enqueueWork(() -> {
|
||||||
EffortlessBuilding.log("AddUndoMessage");
|
|
||||||
|
|
||||||
if (ctx.get().getDirection().getReceptionSide() == LogicalSide.CLIENT) {
|
if (ctx.get().getDirection().getReceptionSide() == LogicalSide.CLIENT) {
|
||||||
//Received clientside
|
//Received clientside
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,6 @@ public class BlockBrokenMessage {
|
|||||||
{
|
{
|
||||||
public static void handle(BlockBrokenMessage message, Supplier<NetworkEvent.Context> ctx)
|
public static void handle(BlockBrokenMessage message, Supplier<NetworkEvent.Context> ctx)
|
||||||
{
|
{
|
||||||
EffortlessBuilding.log("BlockBrokenMessage");
|
|
||||||
ctx.get().enqueueWork(() -> {
|
ctx.get().enqueueWork(() -> {
|
||||||
if (ctx.get().getDirection().getReceptionSide() == LogicalSide.SERVER) {
|
if (ctx.get().getDirection().getReceptionSide() == LogicalSide.SERVER) {
|
||||||
//Received serverside
|
//Received serverside
|
||||||
|
|||||||
@@ -95,8 +95,6 @@ public class BlockPlacedMessage {
|
|||||||
public static void handle(BlockPlacedMessage message, Supplier<NetworkEvent.Context> ctx)
|
public static void handle(BlockPlacedMessage message, Supplier<NetworkEvent.Context> ctx)
|
||||||
{
|
{
|
||||||
ctx.get().enqueueWork(() -> {
|
ctx.get().enqueueWork(() -> {
|
||||||
EffortlessBuilding.log("BlockPlacedMessage");
|
|
||||||
|
|
||||||
if (ctx.get().getDirection().getReceptionSide() == LogicalSide.CLIENT) {
|
if (ctx.get().getDirection().getReceptionSide() == LogicalSide.CLIENT) {
|
||||||
//Received clientside
|
//Received clientside
|
||||||
//Nod RenderHandler to do the dissolve shader effect
|
//Nod RenderHandler to do the dissolve shader effect
|
||||||
|
|||||||
@@ -25,8 +25,6 @@ public class CancelModeMessage {
|
|||||||
public static void handle(CancelModeMessage message, Supplier<NetworkEvent.Context> ctx)
|
public static void handle(CancelModeMessage message, Supplier<NetworkEvent.Context> ctx)
|
||||||
{
|
{
|
||||||
ctx.get().enqueueWork(() -> {
|
ctx.get().enqueueWork(() -> {
|
||||||
EffortlessBuilding.log("CancelModeMessage");
|
|
||||||
|
|
||||||
EntityPlayer player = EffortlessBuilding.proxy.getPlayerEntityFromContext(ctx);
|
EntityPlayer player = EffortlessBuilding.proxy.getPlayerEntityFromContext(ctx);
|
||||||
|
|
||||||
BuildModes.initializeMode(player);
|
BuildModes.initializeMode(player);
|
||||||
|
|||||||
@@ -30,8 +30,6 @@ public class ClearUndoMessage {
|
|||||||
public static void handle(ClearUndoMessage message, Supplier<NetworkEvent.Context> ctx)
|
public static void handle(ClearUndoMessage message, Supplier<NetworkEvent.Context> ctx)
|
||||||
{
|
{
|
||||||
ctx.get().enqueueWork(() -> {
|
ctx.get().enqueueWork(() -> {
|
||||||
EffortlessBuilding.log("ClearUndoMessage");
|
|
||||||
|
|
||||||
if (ctx.get().getDirection().getReceptionSide() == LogicalSide.CLIENT) {
|
if (ctx.get().getDirection().getReceptionSide() == LogicalSide.CLIENT) {
|
||||||
//Received clientside
|
//Received clientside
|
||||||
EntityPlayer player = EffortlessBuilding.proxy.getPlayerEntityFromContext(ctx);
|
EntityPlayer player = EffortlessBuilding.proxy.getPlayerEntityFromContext(ctx);
|
||||||
|
|||||||
@@ -36,8 +36,6 @@ public class ModeActionMessage {
|
|||||||
public static void handle(ModeActionMessage message, Supplier<NetworkEvent.Context> ctx)
|
public static void handle(ModeActionMessage message, Supplier<NetworkEvent.Context> ctx)
|
||||||
{
|
{
|
||||||
ctx.get().enqueueWork(() -> {
|
ctx.get().enqueueWork(() -> {
|
||||||
EffortlessBuilding.log("ModeActionMessage");
|
|
||||||
|
|
||||||
EntityPlayer player = EffortlessBuilding.proxy.getPlayerEntityFromContext(ctx);
|
EntityPlayer player = EffortlessBuilding.proxy.getPlayerEntityFromContext(ctx);
|
||||||
|
|
||||||
ModeOptions.performAction(player, message.action);
|
ModeOptions.performAction(player, message.action);
|
||||||
|
|||||||
@@ -41,8 +41,6 @@ public class ModeSettingsMessage {
|
|||||||
public static void handle(ModeSettingsMessage message, Supplier<NetworkEvent.Context> ctx)
|
public static void handle(ModeSettingsMessage message, Supplier<NetworkEvent.Context> ctx)
|
||||||
{
|
{
|
||||||
ctx.get().enqueueWork(() -> {
|
ctx.get().enqueueWork(() -> {
|
||||||
EffortlessBuilding.log("ModeSettingsMessage");
|
|
||||||
|
|
||||||
EntityPlayer player = EffortlessBuilding.proxy.getPlayerEntityFromContext(ctx);
|
EntityPlayer player = EffortlessBuilding.proxy.getPlayerEntityFromContext(ctx);
|
||||||
|
|
||||||
// Sanitize
|
// Sanitize
|
||||||
|
|||||||
@@ -129,8 +129,6 @@ public class ModifierSettingsMessage {
|
|||||||
public static void handle(ModifierSettingsMessage message, Supplier<NetworkEvent.Context> ctx)
|
public static void handle(ModifierSettingsMessage message, Supplier<NetworkEvent.Context> ctx)
|
||||||
{
|
{
|
||||||
ctx.get().enqueueWork(() -> {
|
ctx.get().enqueueWork(() -> {
|
||||||
EffortlessBuilding.log("ModifierSettingsMessage");
|
|
||||||
|
|
||||||
EntityPlayer player = EffortlessBuilding.proxy.getPlayerEntityFromContext(ctx);
|
EntityPlayer player = EffortlessBuilding.proxy.getPlayerEntityFromContext(ctx);
|
||||||
|
|
||||||
// Sanitize
|
// Sanitize
|
||||||
|
|||||||
@@ -49,8 +49,6 @@ public class RequestLookAtMessage {
|
|||||||
public static void handle(RequestLookAtMessage message, Supplier<NetworkEvent.Context> ctx)
|
public static void handle(RequestLookAtMessage message, Supplier<NetworkEvent.Context> ctx)
|
||||||
{
|
{
|
||||||
ctx.get().enqueueWork(() -> {
|
ctx.get().enqueueWork(() -> {
|
||||||
EffortlessBuilding.log("RequestLookAtMessage");
|
|
||||||
|
|
||||||
if (ctx.get().getDirection().getReceptionSide() == LogicalSide.CLIENT) {
|
if (ctx.get().getDirection().getReceptionSide() == LogicalSide.CLIENT) {
|
||||||
//Received clientside
|
//Received clientside
|
||||||
//Send back your info
|
//Send back your info
|
||||||
|
|||||||
@@ -198,13 +198,15 @@ public class BlockPreviewRenderer {
|
|||||||
//if so, renew randomness of randomizer bag
|
//if so, renew randomness of randomizer bag
|
||||||
ItemRandomizerBag.renewRandomness();
|
ItemRandomizerBag.renewRandomness();
|
||||||
//and play sound (max once every tick)
|
//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;
|
soundTime = ClientProxy.ticksInGame;
|
||||||
|
|
||||||
SoundType soundType = blockStates.get(0).getBlock().getSoundType(blockStates.get(0), player.world,
|
if (blockStates.get(0) != null) {
|
||||||
newCoordinates.get(0), player);
|
SoundType soundType = blockStates.get(0).getBlock().getSoundType(blockStates.get(0), player.world,
|
||||||
player.world.playSound(player, player.getPosition(), breaking ? soundType.getBreakSound() : soundType.getPlaceSound(),
|
newCoordinates.get(0), player);
|
||||||
SoundCategory.BLOCKS, 0.3f, 0.8f);
|
player.world.playSound(player, player.getPosition(), breaking ? soundType.getBreakSound() : soundType.getPlaceSound(),
|
||||||
|
SoundCategory.BLOCKS, 0.3f, 0.8f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -203,6 +203,8 @@ public class RenderHandler implements IWorldEventListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected static void renderBlockPreview(BlockRendererDispatcher dispatcher, BlockPos blockPos, IBlockState blockState) {
|
protected static void renderBlockPreview(BlockRendererDispatcher dispatcher, BlockPos blockPos, IBlockState blockState) {
|
||||||
|
if (blockState == null) return;
|
||||||
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
GlStateManager.translatef(blockPos.getX(), blockPos.getY(), blockPos.getZ());
|
GlStateManager.translatef(blockPos.getX(), blockPos.getY(), blockPos.getZ());
|
||||||
GlStateManager.rotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
GlStateManager.rotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||||
|
|||||||
Reference in New Issue
Block a user