The Great Refactor Part 1 - connector -> core

This commit is contained in:
RednedEpic 2021-11-20 13:56:40 -06:00
parent a4b2e05132
commit 0b5009b415
573 changed files with 135 additions and 135 deletions

8
.gitmodules vendored
View file

@ -1,6 +1,6 @@
[submodule "connector/src/main/resources/mappings"]
path = connector/src/main/resources/mappings
[submodule "core/src/main/resources/mappings"]
path = core/src/main/resources/mappings
url = https://github.com/GeyserMC/mappings.git
[submodule "connector/src/main/resources/languages"]
path = connector/src/main/resources/languages
[submodule "core/src/main/resources/languages"]
path = core/src/main/resources/languages
url = https://github.com/GeyserMC/languages.git

View file

@ -13,7 +13,7 @@
<dependencies>
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>connector</artifactId>
<artifactId>core</artifactId>
<version>1.4.3-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

View file

@ -20,7 +20,7 @@
<dependencies>
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>connector</artifactId>
<artifactId>core</artifactId>
<version>1.4.3-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

View file

@ -13,7 +13,7 @@
<dependencies>
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>connector</artifactId>
<artifactId>core</artifactId>
<version>1.4.3-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

View file

@ -13,7 +13,7 @@
<dependencies>
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>connector</artifactId>
<artifactId>core</artifactId>
<version>1.4.3-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

View file

@ -13,7 +13,7 @@
<dependencies>
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>connector</artifactId>
<artifactId>core</artifactId>
<version>1.4.3-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

@ -1 +0,0 @@
Subproject commit d12420771ea5e13083b3556552298d164767aae9

@ -1 +0,0 @@
Subproject commit 5b6239f0a43ec9a38d65ed53b8d1bfaf564c1c3b

View file

@ -8,7 +8,7 @@
<artifactId>geyser-parent</artifactId>
<version>1.4.3-SNAPSHOT</version>
</parent>
<artifactId>connector</artifactId>
<artifactId>core</artifactId>
<properties>
<adventure.version>4.9.3</adventure.version>

View file

@ -1,56 +1,56 @@
/*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @author GeyserMC
* @link https://github.com/GeyserMC/Geyser
*/
package org.geysermc.connector.entity;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata;
import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import org.geysermc.connector.network.session.GeyserSession;
import java.util.UUID;
public class FallingBlockEntity extends Entity {
private final int javaId;
public FallingBlockEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, Vector3f position, Vector3f motion, float yaw, float pitch, int javaId) {
super(session, entityId, geyserId, uuid, EntityDefinitions.FALLING_BLOCK, position, motion, yaw, pitch, 0f);
this.javaId = javaId;
}
@Override
protected void initializeMetadata() {
super.initializeMetadata();
this.dirtyMetadata.put(EntityData.VARIANT, session.getBlockMappings().getBedrockBlockId(javaId));
}
@Override
public void setGravity(BooleanEntityMetadata entityMetadata) {
super.setGravity(entityMetadata);
// Set the NO_AI flag based on the no gravity flag to prevent movement
setFlag(EntityFlag.NO_AI, entityMetadata.getPrimitiveValue());
}
}
/*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @author GeyserMC
* @link https://github.com/GeyserMC/Geyser
*/
package org.geysermc.connector.entity;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata;
import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import org.geysermc.connector.network.session.GeyserSession;
import java.util.UUID;
public class FallingBlockEntity extends Entity {
private final int javaId;
public FallingBlockEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, Vector3f position, Vector3f motion, float yaw, float pitch, int javaId) {
super(session, entityId, geyserId, uuid, EntityDefinitions.FALLING_BLOCK, position, motion, yaw, pitch, 0f);
this.javaId = javaId;
}
@Override
protected void initializeMetadata() {
super.initializeMetadata();
this.dirtyMetadata.put(EntityData.VARIANT, session.getBlockMappings().getBedrockBlockId(javaId));
}
@Override
public void setGravity(BooleanEntityMetadata entityMetadata) {
super.setGravity(entityMetadata);
// Set the NO_AI flag based on the no gravity flag to prevent movement
setFlag(EntityFlag.NO_AI, entityMetadata.getPrimitiveValue());
}
}

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